CCamoCrypt
DeFi Explained

Impermanent loss, explained arithmetically

Impermanent loss is a comparison, not a hack. We derive it from x*y=k, work a full example, and give the exact formula and a table of values.

Quick answer

Impermanent loss compares the value of tokens left in a constant product pool against simply holding them. When prices diverge, arbitrage rebalances the pool so it holds less of the appreciating asset. Using x*y=k, a 2x price move produces about 5.7% loss versus holding, before fees. The exact formula is 2*sqrt(r)/(1+r)-1.

Key points

  • Impermanent loss measures pool value against passively holding the same two tokens.
  • It arises because arbitrage forces the pool to sell the rising asset and buy the falling one.
  • The closed form is IL(r) = 2*sqrt(r)/(1+r) - 1, and it is always zero or negative.
  • A 2x price divergence yields roughly 5.72% loss before fees; larger divergence costs more.
  • Swap fees work in the opposite direction, but whether they offset IL cannot be promised.

What impermanent loss actually measures

Impermanent loss (IL) is not a fee, a hack, or a bug. It is a comparison. It measures the difference between the value of tokens left inside a constant product liquidity pool and the value those same tokens would have had if you had simply held them in a wallet. The word impermanent reflects that the gap closes if relative prices return to where they started; it becomes permanent only when you withdraw while prices are dislocated.

This article shows the arithmetic honestly, with a worked example. The numbers below are illustrative units chosen to make the maths clear. They are not a forecast, a recommendation, or a claim about any real asset. IL is a property of the pool formula, and understanding it is a risk-management exercise, not a return calculation.

The setup

Recall the constant product invariant from AMM mechanics. A pool holds reserve x of token A and reserve y of token B, with:

x * y = k

The pool’s price of A in terms of B is the reserve ratio P = y / x. When the external market price of A changes, arbitrage traders trade against the pool until its ratio again equals the market price. That rebalancing is exactly what causes impermanent loss: the pool is forced to sell whichever asset is appreciating and buy whichever is depreciating, always ending with less of the winner than a passive holder would have.

Deriving the rebalanced reserves

Suppose the price of A moves from P to a new price P'. Two conditions must hold at the new equilibrium: the invariant x' * y' = k, and the new pool price y' / x' = P'. Solving those two equations gives the new reserves directly:

x' = sqrt(k / P')
y' = sqrt(k * P')

These two expressions are all we need. Notice that as P' rises, x' falls and y' rises: the pool has shed the appreciating asset A and accumulated B. That is the arbitrageur’s trade, and the LP is on the other side of it.

A worked example

Start with a pool holding 10 units of A and 1,000 units of B. Then:

  • k = x * y = 10 * 1,000 = 10,000
  • Initial price of A: P = y / x = 1,000 / 10 = 100 B per A.

Now suppose the market price of A doubles, so P' = 200 B per A. Apply the formulas:

  • x' = sqrt(10,000 / 200) = sqrt(50) = 7.0711 units of A
  • y' = sqrt(10,000 * 200) = sqrt(2,000,000) = 1,414.21 units of B

Check the invariant: 7.0711 * 1,414.21 = 10,000. Check the price: 1,414.21 / 7.0711 = 200. Both hold.

Now compare the two outcomes

Value the position in units of B at the new price P' = 200.

Scenario Holdings Value in B at P’=200
Held in wallet 10 A + 1,000 B (10 × 200) + 1,000 = 3,000
Left in the pool 7.0711 A + 1,414.21 B (7.0711 × 200) + 1,414.21 = 2,828.4

The pool position is worth 2,828.4 versus 3,000 for holding. The shortfall is:

(2,828.4 - 3,000) / 3,000 = -0.0572 = -5.72%

So a 2x move in one asset produces roughly a 5.7% impermanent loss relative to holding, before any fees. The pool did nothing wrong; the invariant simply forced it to sell A as A rose.

The closed-form formula

The same result generalises. If r is the ratio of the new price to the old price (r = P' / P), the impermanent loss relative to holding is:

IL(r) = 2 * sqrt(r) / (1 + r) - 1

For our example r = 2: 2 * sqrt(2) / 3 - 1 = 2.8284 / 3 - 1 = -0.0572, matching the worked example. Two features of this formula matter. First, IL is always zero or negative: 2*sqrt(r)/(1+r) never exceeds 1, so the pool never beats holding on price alone. Second, it is symmetric in a specific sense: a halving (r = 0.5) produces the same loss as a doubling (r = 2).

Impermanent loss at different price ratios

Because the formula is deterministic, we can tabulate it exactly. These are arithmetic outputs of the formula above, not predictions.

Price ratio r Impermanent loss vs holding
1.00 (no change) 0.00%
1.25 -0.62%
1.50 -2.02%
2.00 -5.72%
3.00 -13.40%
4.00 -20.00%
5.00 -25.46%

The loss grows with the size of the divergence but at a decelerating rate. Small relative moves cost very little; large divergences are where the effect bites.

The mirror case: a halving

To see the symmetry directly, keep the same starting pool of 10 A and 1,000 B, with k = 10,000 and P = 100, but now let the price of A fall by half to P' = 50. Apply the formulas:

  • x' = sqrt(10,000 / 50) = sqrt(200) = 14.142 units of A
  • y' = sqrt(10,000 * 50) = sqrt(500,000) = 707.11 units of B

Now the pool has accumulated the depreciating asset A and shed B, the opposite of the doubling case. Value the position at the new price:

  • Held: (10 × 50) + 1,000 = 1,500
  • Pool: (14.142 × 50) + 707.11 = 1,414.2

The shortfall is (1,414.2 - 1,500) / 1,500 = -5.72%, identical to the doubling case. This confirms the formula’s symmetry: r = 0.5 and r = 2 represent the same proportional divergence and produce the same impermanent loss. The pool is always forced to hold more of whichever asset performed worse.

What impermanent loss is not

It is worth separating impermanent loss from risks it is often confused with. It is not a smart contract exploit, a fee, or a slippage cost, and it does not depend on trading volume. It is a pure consequence of the pricing formula rebalancing the pool as relative prices move. A pool can be perfectly secure, audited, and heavily used and still impose impermanent loss on its providers, because the effect is baked into the mathematics rather than being a defect. Conversely, impermanent loss says nothing about the far larger risk that a token in the pair could fail outright, which is a separate and potentially total loss unrelated to the arithmetic here.

Where fees fit in

The comparison above deliberately excludes trading fees. In a live pool, LPs also collect a share of every swap fee, which accrues to the reserves and works in the opposite direction to impermanent loss. Whether the accumulated fees exceed the impermanent loss over any given period depends on trading volume, volatility, and how far prices ultimately diverge. That outcome cannot be known in advance and is not promised here. The honest statement is only this: impermanent loss is a real, quantifiable drag that must be weighed against fee income, not ignored.

Reading the result correctly

  • IL is a comparison to holding, not an absolute loss. In nominal terms a pool position can still be worth more than the deposit while underperforming a passive hold.
  • It becomes permanent only on withdrawal; if prices revert to the entry ratio, the gap disappears.
  • It is largest for volatile, divergent pairs and smallest for assets that track each other, which is why stable-to-stable pools are designed to minimise it.
  • It is a mathematical certainty of the constant product design, not a sign that anything failed.

Sources

Frequently asked questions

Why is it called impermanent?
Because the gap versus holding closes if relative prices return to the ratio you entered at. It only becomes permanent when you withdraw while prices are still diverged, locking in the difference.
Does impermanent loss mean I lose money outright?
Not necessarily. It is a comparison to holding, not an absolute loss. A pool position can still be worth more in nominal terms than your deposit while underperforming what you would have had by simply holding the two tokens.
Why does a halving cause the same loss as a doubling?
The formula 2*sqrt(r)/(1+r)-1 gives the same value for r=0.5 and r=2. Both represent the same proportional divergence between the two assets, so the constant product curve rebalances by the same relative amount.
How do fees relate to impermanent loss?
Fees accrue to the pool reserves and push value up, while impermanent loss pushes it down relative to holding. Whether fees exceed the loss over a period depends on volume and how far prices move, which cannot be known ahead of time.
Which pools minimise impermanent loss?
Pools of assets that track each other closely, such as two stablecoins referenced to the same currency, diverge little, so impermanent loss stays small. Volatile, unrelated pairs experience the largest effect.
Is impermanent loss the same in concentrated liquidity pools?
The principle is the same, but concentrating liquidity into a price range changes the magnitude and can amplify the effect within that range, and the position becomes entirely one asset at the range edges. The arithmetic differs from the simple constant product case.

Note: CamoCrypt is security & education only — no prices, no predictions, no investment advice. Verify every address and contract yourself; we cannot recover lost funds and neither can anyone who contacts you claiming they can.