Uniswap v3 Features Explained in Depth
By: 田少谷 Shao
Tags: Uniswap, Uniswap V3, Decentralized Exchange, Ethereum, Defi

Case 2 & 3: current price does not belong to the targeted price range

Unlike Case 1 where both tokens are required for providing liquidity, in Cases 2 and 3 only one of the two tokens is required/allowed.

To understand the reason for the above statement, we’d have to first revisit how price is discovered on Uniswap with the equation x * y = k , for x & y stand for the amount of two tokens X and Y and k as a constant.

The price of X compared to Y is y / x , which means how many Y one can get for 1 unit of X, and vice versa the price of Y compared to X is x / y .

For the price of X to go up, y has to increase and x decrease.

With this pricing mechanism in mind, it’s example time!

Say an LP plans to place liquidity in the price range [15.625, 17.313], higher than the current price of X 10 , when 100(x) * 1000(y) = 100000(k) , which is Case 2.

The price of X is 1250 / 80 = 15.625 when the equation is 80 * 1250 = 100000 .

when the equation is . The price of X is 1315.789 / 76 = 17.313 when the equation is 76 * 1315.789 = 100000 .

If now the price of X reaches 15.625, the only way for the price of X to go even higher is to further increase y and decrease x , which means exchanging a certain amount of X for Y.

Thus, to provide liquidity in the range [15.625, 17.313], an LP needs only to prepare 80 — 76 = 4 of X. If the price exceeds 17.313, all 4 X of the LP is swapped into 1315.789 — 1250 = 65.798 Y, and then the LP has nothing more to do with the pool, as his/her liquidity is drained.

What if the price stays in the range? It’s exactly what LPs would love to see, as they can earn swapping fees for all transactions in the range! Also, the balance of X will swing between [76, 80] and the balance of Y between [1250, 1315.789].

This might not be obvious, but the example above shows an interesting insight: if the liquidity of one token is provided, only when the token becomes more valuable will it be exchanged for the less valuable one.

…wut?

Remember that if 4 X is provided within [15.625, 17.313], only when the price of X goes up from 15.625 to 17.313 is 4 X gradually swapped into Y, the less valuable one!

This is the reason why in Cases 2 & 3 only one of the two tokens is required/allowed when providing liquidity: in fact, LPs providing liquidity is essentially providing a token for others to exchange when that token becomes more valuable!

What if the price of X drops back to 15.625 immediately after reaching 17.313? As X becomes less valuable, others are going to exchange Y for X, which can eventually make the 65.798 Y (previously swapped from 4 X) be swapped back into 4 X.

The below image illustrates the scenario of DAI/USDC pair with a price range of [1.001, 1.002] well: the pool is always composed entirely of one token on both sides of the tick, while in the middle 1.001499⁷ is of both tokens.

Similarly, to provide liquidity in a price range < current price, which is Case 3, an LP has to prepare a certain amount of Y for others to exchange Y for X within the range.

To wrap up such an interesting feature, we know that:

Only one token is required for Cases 2 & 3, while both tokens are required for Case 1. Only when the current price is within the range of the range order can LP earn trading fees. This is the main reason why most people believe LPs of v3 have to monitor the price more actively to maximize their income, which also means that LPs of v3 have become arbitrageurs 🤯

I will be discussing more the impacts of v3 in 5. Impacts of v3.