It is easy to deposit two tokens into a Uniswap V2 pool and lose track of whether the position is actually profitable. This calculator reconstructs your position from first principles: it applies the constant-product rule to find your current token balances, values them at today’s prices, compares against simply holding, and folds in your accumulated fees to give a clear net profit or loss.
How it works
A constant-product pool holds reserves whose product is invariant. Your share rebalances as the price ratio shifts:
k = x₀ × y₀ (your deposited token product)
price ratio p = priceX / priceY (current, in same units)
new x = √(k / p) (rebalanced token amounts)
new y = √(k × p)
LP value = new x × priceX + new y × priceY
HODL value = x₀ × priceX + y₀ × priceY
impermanent loss = LP value − HODL value (≤ 0)
net P&L = LP value + fees − initial deposit value
The square-root rebalancing is the constant-product invariant at work: the pool automatically trims your holding of whichever asset has risen and adds to the one that has fallen.
Worked example
For example, deposit 1 ETH at 2,000 and 2,000 USDC (4,000 total deposited). If ETH rises to 4,000:
- Pool rebalances to roughly 0.707 ETH and 2,828 USDC
- LP value: 0.707 × 4,000 + 2,828 = approximately 5,656
- HODL value: 1 × 4,000 + 2,000 = 6,000
- Impermanent loss: approximately −344 (about 5.7% of HODL value)
If you have earned 400 in fees over the same period, the net result is 5,656 + 400 − 4,000 = +2,056 versus a HODL gain of 2,000. The fee income more than covered the impermanent loss in this case, but that depends entirely on trading volume in the pool.
What the fee income variable means
Trading fees are the mechanism that is supposed to compensate liquidity providers for impermanent loss. Whether they actually do depends on the pool’s fee tier and trading volume relative to the price divergence. High-volume, low-volatility pairs (stablecoin pairs, ETH/WBTC) tend to accumulate fees faster relative to impermanent loss. High-volatility pairs (small-cap altcoins) often have the opposite profile.
The fee income field in this calculator is intentionally manual: you need to read it from the pool protocol or your position manager, because the constant-product formula cannot derive it from prices alone.
V2 versus V3
This calculator models the Uniswap V2 constant-product model, which spreads your liquidity uniformly across all possible prices. Uniswap V3 lets you concentrate liquidity within a price range, amplifying fee income (and impermanent loss) when the price stays in range, but converting your entire position to one token when it moves out of range. The formulas differ significantly for V3 positions.