Understanding the impermanent loss calculator — concept and principle
Impermanent loss is the shortfall a liquidity provider suffers compared with simply holding the two tokens, caused by a change in their relative price. This calculator handles the classic 50/50 constant-product pool used by Uniswap v2 and many similar exchanges: enter how much token A's price changed against token B and the amount you deposited, and it shows the value in the pool versus the value if held.
How it is calculated
Let k be the price ratio after the move (a +100% change gives k = 2, a −50% change gives k = 0.5).
- Impermanent loss = 2√k ÷ (1 + k) − 1.
- Value if held = deposit × (1 + k) ÷ 2, since half the deposit was in A (which changed by k) and half in B.
- Value in pool = value if held × (1 + IL), which equals deposit × √k.
- Difference = pool value − held value. Trading fees earned are not included.
The principle
A constant-product pool keeps x × y fixed, where x and y are the token reserves. When A's price rises elsewhere, arbitrage traders buy the cheap A from the pool until its price matches the market, leaving the pool with less A and more B. You end up automatically selling the token that went up and buying the one that went down. The pool's value grows only with √k, while holding grows with (1 + k) ÷ 2, and the second is always at least as large. The loss is called impermanent because it disappears if the ratio returns to where you started.
Worked example
- Inputs: price change +100% (k = 2), deposit 10,000.
- IL = 2 × √2 ÷ 3 − 1 = 2.8284 ÷ 3 − 1 = −5.72%.
- Value if held = 10,000 × 3 ÷ 2 = $15,000.00.
- Value in pool = 15,000 × 0.94281 = $14,142.14 (= 10,000 × √2).
- Difference = 14,142.14 − 15,000 = −$857.86.
How to read the result
Loss grows with the size of the move in either direction: about −0.6% for a 1.25× move, −2.0% at 1.5×, −5.7% at 2× (or a halving), −13.4% at 3× and −25.5% at 5×. A pool is worthwhile only if the fees you earn over the holding period exceed this gap. Stable pairs of similar assets usually show little impermanent loss.
Common mistakes
- Thinking the pool lost money in absolute terms; here it is up 41%, just less than holding.
- Applying this formula to concentrated-liquidity pools (Uniswap v3 style) or weighted pools, which behave differently.
- Forgetting gas costs, and that the loss becomes permanent once you withdraw at a changed price.
Frequently asked questions
How much is impermanent loss if the price doubles?
About −5.72% compared with holding. The same applies if the price halves.
Does impermanent loss happen if both tokens rise together?
Only their relative price matters. If both rise by the same percentage, k = 1 and the loss is zero.
Can fees offset impermanent loss?
Yes. Busy pools can earn enough trading fees to cover moderate moves; compare expected fee income with the loss here.
Sources: Adams, Zinsser & Robinson (2020), Uniswap v2 Core whitepaper.