Impermanent Loss Calculator
Calculate impermanent loss for DeFi liquidity pools. Compare HODL value versus LP pool value and see how price divergence affects your AMM position.
2.02% loss vs simply holding
$10,000.00
$9,797.96
Price Ratio Divergence
Token Holdings Comparison
The LP pool automatically holds more of the depreciated token and less of the appreciated token — this rebalancing is the source of impermanent loss.
Impermanent Loss Divergence Table — Asset A Price Scenarios
| Price Scenario | HODL Value | LP Pool Value | IL ($) | IL (%) |
|---|---|---|---|---|
| Asset A -90% | $5,500.00 | $3,162.28 | -2,337.72 | -42.50% |
| Asset A -75% | $6,250.00 | $5,000.00 | -1,250.00 | -20.00% |
| Asset A -50% | $7,500.00 | $7,071.07 | -428.93 | -5.72% |
| Asset A -25% | $8,750.00 | $8,660.25 | -89.75 | -1.03% |
| No change | $10,000.00 | $10,000.00 | $0.00 | 0.00% |
| Asset A +25% | $11,250.00 | $11,180.34 | -69.66 | -0.62% |
| Asset A +50% | $12,500.00 | $12,247.45 | -252.55 | -2.02% |
| Asset A +100% | $15,000.00 | $14,142.14 | -857.86 | -5.72% |
| Asset A +200% | $20,000.00 | $17,320.51 | -2,679.49 | -13.40% |
| Asset A +300% | $25,000.00 | $20,000.00 | -5,000.00 | -20.00% |
| Asset A +500% | $35,000.00 | $24,494.90 | -10,505.10 | -30.01% |
Advertisement
1. What Is Impermanent Loss in DeFi Liquidity Pools?
Impermanent loss (IL) is the hidden cost of providing liquidity to an automated market maker (AMM) like Uniswap, SushiSwap, or PancakeSwap. When you deposit two tokens into a liquidity pool, the AMM enforces a constant-product formula (x * y = k) that automatically rebalances the pool as prices move. If the two tokens' prices diverge from the ratio at which you deposited, the pool will have sold the appreciating asset and accumulated more of the depreciating one. The result: your pool position is worth less than if you had simply held both tokens in your wallet. This value gap is the impermanent loss. It is called "impermanent" because if prices revert to the original ratio before you withdraw, the loss disappears — but if you withdraw while prices are still diverged, the loss becomes permanent.
2. The Constant-Product Formula and IL Mathematics
The standard 50/50 AMM pool maintains the invariant x * y = k, where x and y are the reserves of token A and token B. When the market price of the two tokens changes, arbitrageurs trade against the pool until the pool's internal price matches the external market price. This rebalancing changes the quantities of each token in the pool. The impermanent loss as a function of the price ratio r is:
Price ratio: k = (priceA1 / priceA0) / (priceB1 / priceB0)
Initial amounts: assetA = (V0 / 2) / priceA0
assetB = (V0 / 2) / priceB0
HODL value: V_hodl = (assetA * priceA1) + (assetB * priceB1)
LP pool value: V_lp = V_hodl * (1 + IL_decimal)
Impermanent Loss:
IL_decimal = (2 * sqrt(k) / (1 + k)) - 1 (always <= 0)
IL_usd = V_hodl - V_lp (positive = loss)
IL_pct = (IL_usd / V_hodl) * 100
V0 = total initial investmentThe key insight is that IL depends only on the price ratio r, not on the absolute prices. When r = 1 (no relative price change), IL is zero. A 2x price divergence (k = 2 or k = 0.5) produces approximately 5.72% IL. A 5x divergence produces about 25.46% IL. A 10x divergence produces about 46.06% IL. This non-linear relationship means IL grows slowly for small price movements but accelerates dramatically during extreme volatility.
3. Worked Example: ETH/WBTC Liquidity Position
Suppose you deposit $10,000 into an ETH/WBTC pool when ETH is $3,000 and WBTC is $2,000. Your deposit buys 1.667 ETH ($5,000 worth) and 2.5 WBTC ($5,000 worth). If ETH rises to $3,600 (+20%) while WBTC drops to $1,600 (-20%), the price ratio r = (3600/3000) / (1600/2000) = 1.2 / 0.8 = 1.5. The HODL value would be $10,000 * (1.2 + 0.8) / 2 = $10,000. The LP pool value is $10,000 * 2 * sqrt(1.5) / (1 + 1.5) = $10,000 * 2.449 / 2.5 = $9,798. Your impermanent loss is $10,000 - $9,798 = $202, or about 2.02%. This $202 would need to be recovered by trading fees for the LP position to outperform simply holding.