What a Uniswap LP owns in V2 and V3

Follow the same two tokens through a proportional V2 deposit and a concentrated V3 position, then move the price to the edge of the range.

jesjupyter (reviewed by ret2basic.eth)5 min read
What a Uniswap LP owns in V2 and V3

At a price of 4 units of token1 per token0, an LP has 20 token0 and 120 token1. That inventory is worth 200 token1. In V2 the router would use 20 token0 and 80 token1 for a proportional deposit at this price. In V3 the LP can put all 20 and 120 to work by choosing a suitable range. The trade-off becomes visible when the price reaches the top of that range and the position holds only token1.

What a V2 LP token measures#

Suppose an existing pair holds 100 token0 and 400 token1, with 200 LP shares outstanding. Treat the numbers as whole-token equivalents. Ignore rounding and protocol fee minting. A provider adds 10 and 40. For an established pair, mint computes the shares allowed by each side of the deposit and takes the smaller number.

min⁡(10×200100,40×200400)=20.\min\left(\frac{10\times200}{100},\frac{40\times200}{400}\right)=20.

The new LP owns 20 of 220 shares. One eleventh of the updated reserves, 110 and 440, is exactly 10 and 40. The existing holders still own their original quantities immediately after this proportional deposit. Uniswap V2 pair, mint and burn

The first mint is special. The pair starts from the integer square root of the product of the incoming amounts and permanently locks a minimum number of LP shares. After that first mint, each LP token represents a fraction of the reserves. With protocol fee minting switched off, swap fees can grow the reserves while the number of LP shares stays fixed. A change in the ratio between xy\sqrt{xy} and the LP supply explains how one share can claim more assets over time. The pair can account for each LP’s fraction throughout.

What happens to an uneven deposit?#

Start again at 100 and 400. This time the provider offers 10 and 80. With the usual V2 router, suitable minimum amounts and no change in the quoted reserves, the limiting side is token0. The router transfers 10 and 40 into the pair. The other 40 token1 remains with the provider.

If all 10 and 80 have instead been transferred directly to the pair before its mint, the two share calculations give 20 and 40. The pair still mints 20. Its reserves now include the entire transfer, so even the existing LPs have a claim on part of the surplus token1. The router chooses the transfer amounts. The pair counts what actually arrived. V2 router liquidity calculation

What a V3 range buys with the same capital#

Use PP for token1 per token0 and LL for a position’s liquidity. Inside bounds PaP_a and PbP_b, the position’s principal amounts are

x=L(1P−1Pb),y=L(P−Pa).x=L\left(\frac{1}{\sqrt{P}}-\frac{1}{\sqrt{P_b}}\right), \qquad y=L\left(\sqrt{P}-\sqrt{P_a}\right).

Take Pa=1P_a=1, Pb=9P_b=9 and L=120L=120. At P=4P=4, the position needs 120(1/2−1/3)=20120(1/2-1/3)=20 token0 and 120(2−1)=120120(2-1)=120 token1. This is the inventory from the opening. The prices here are idealized range boundaries. A real pool represents boundaries at allowed ticks and rounds token amounts in their smallest units. Uniswap V3 whitepaper, §2 · V3 square-root price math

A full-range position in the idealized model would need L/P=60L/\sqrt P=60 token0 and LP=240L\sqrt P=240 token1 to give the same L=120L=120 at this price. That inventory would cost 480 token1. With 200 token1 of capital, full-range liquidity at this price is only 50. The narrower range supplies more depth while the price is inside it.

Follow the position to a boundary#

Price of token0 in token1Position’s token0Position’s token1
1, the lower boundary800
4, inside the range20120
9, the upper boundary0240

As buyers take token0 out, token1 flows into the position. At the top it holds 240 token1. Holding the original 20 token0 and 120 token1 outside the pool would now be worth 20×9+120=30020\times9+120=300 token1. The 60 difference in this example is before fees. Above the upper tick the position supplies no active trading depth and earns no new swap fees there. If price re-enters the range, it can participate again.

How the pool knows which liquidity is active#

LPs can enter the same range on different days and at different prices. Their required token amounts depend on the current square-root price at each mint. Between adjacent initialized ticks, the pool aggregates the LL of all active positions. The virtual reserves over that interval are L/PL/\sqrt P and LPL\sqrt P, whose product is L2L^2. A single position’s real token amounts follow the bounded formulas above.

The tick map lets the pool change this aggregate without walking all the positions. Suppose our position with L=120L=120 ends at the same tick where another with L=30L=30 begins, and there are no others. Crossing that tick upwards applies a net change of −120+30=−90-120+30=-90. Active liquidity moves from 120 to 30. Crossing downwards applies the opposite sign. A swap spanning the boundary prices its next step using the new depth. V3 pool, position updates and tick crossing

For a V2 position, the LP-share fraction and the pair’s reserves tell you what can be redeemed. For a V3 position, start with its bounds, its own liquidity and the current price to recover principal. Account for fees separately. Those are the quantities that explain both the extra depth at 4 and the all-token1 inventory at 9.

Worth sharing?

Send this analysis to another reviewer.

Share on X