Only one number decides your impermanent loss

Divergence loss in a constant-product pool depends only on how two prices moved relative to each other, and it has a closed form short enough to memorise. Here is where it comes from, a worked example with every reserve shown, and the fee yield that pays for it.

“Impermanent loss” is a bad name for a real thing. It is not impermanent — if you withdraw, it is as permanent as any other loss — and it is not a loss in the sense of ending with less money than you started with. It is an opportunity cost: the gap between what your liquidity position is worth and what the same two assets would have been worth if you had simply held them.

The useful thing about it is that it is completely determined. For a constant-product pool it depends on exactly one number, and that number is not either price. It is the ratio of the two prices, divided by what that ratio was when you deposited.

The model, stated up front

Everything below describes a constant-product, equally weighted, two-asset pool — the Uniswap-v2 design. Reserves satisfy x × y = k, arbitrageurs keep the two sides equal in value, and your share of the pool is a fixed fraction of both reserves.

Concentrated liquidity, weighted pools and stable-swap curves are different curves and obey different arithmetic. If you are in one of those, this page describes the wrong pool, and the numbers will not match your position.

What the pool does to your balances

Deposit a value V₀ and it splits in half: half into asset A at price pA₀, half into asset B at price pB₀. Your opening quantities are.

If you had held those two piles, they would later be worth a₀ × pA₁ + b₀ × pB₁. That is the benchmark. In the pool, something else happens: as the market price moves, arbitrageurs trade against the pool until its internal price matches the market again. They take the profitable side. You take the other one.

When the dust settles, the two halves are equal in value again and the product is still k.

Two equations, two unknowns. Solving them gives the reserves and the position value.

The closed form

Write r for the ratio of ratios — how the relative price of A against B changed.

Substituting the expressions above and simplifying collapses everything into one line.

That is worth staring at for a moment, because of what is not in it. Not the deposit size. Not either price. Not the volatility along the way, or the path taken, or how long you were in. Only r.

Three consequences follow immediately:

  • At r = 1 the expression is exactly 1: if the relative price comes back to where it started, the divergence loss is gone. This is the sense in which the loss is “impermanent”, and it is the only sense.
  • For every other r, it is less than 1. The inequality of arithmetic and geometric means guarantees 2√r ≤ 1 + r, with equality only at r = 1. There is no price move that makes the pool beat holding, before fees.
  • It is symmetric: r and 1/r give the same result. A doubling and a halving cost you exactly the same. This is why “which asset went up” is the wrong question — the pool only sees the ratio.
Relative price change r Pool ÷ hodl Divergence loss
×1.25 (or ÷1.25) 1.25 0.9938 −0.62%
×1.5 1.5 0.9798 −2.02%
×2 2 0.9428 −5.72%
×3 3 0.8660 −13.40%
×4 4 0.8000 −20.00%
×5 5 0.7454 −25.46%
×10 10 0.5750 −42.50%

The shape matters as much as the values. Small divergence is nearly free — a 25% relative move costs 0.62%, which any reasonable fee income covers easily. Large divergence is brutal and gets worse faster than linearly. A pool of two assets that track each other closely is a very different proposition from a pool holding one volatile asset against a stablecoin, and the difference is not a matter of degree.

Worked example, with every number shown

Deposit 10,000 into a 50/50 pool of a volatile asset A and a stablecoin B. A is at 2,000, B is at

  1. Ninety days later A is at 3,000 and B is still 1. The pool advertises a 20% fee APR.

Opening position.

The benchmark — just holding.

hodl = 2.5 × 3,000 + 5,000 × 1
     = 7,500 + 5,000 = 12,500

The pool, after arbitrage.

The divergence loss.

r = (3,000/1) / (2,000/1)
  = 1.5
2√1.5 / 2.5 = 2.449490 / 2.5
            = 0.979796
loss = (0.979796 − 1) × 100
     = −2.0204%
check: 12,247.45/12,500 − 1
     = −2.0204% ✓

Here is what physically happened. The pool went from 2.5 units of A to 2.041241 — it sold 0.458759 units into the rally, receiving 1,123.72 of B. That is an average sale price of 2,449.49, when the asset ended at 3,000. And 2,449.49 is exactly √(2,000 × 3,000), the geometric mean of the starting and ending price. A constant-product pool is a machine that sells the winner on the way up and buys the loser on the way down, at the geometric mean of the two endpoints. Divergence loss is just the bill for that behaviour, and it is the same bill whichever asset happened to win.

Fees, and whether they covered it.

The tool models fee income as a simple, non-compounding yield on the deposited value:

fees = 10,000 × 20/100
     × 90/365 = 493.15
net  = 12,247.45 + 493.15
     = 12,740.60
net−hodl = 12,740.60 − 12,500
         = +240.60, or +1.92%

So this position beat holding, by about 1.9% over ninety days — not because the divergence loss was small in absolute terms (it was 252.55) but because the fee income was twice as large.

The number that actually decides it. Invert the comparison and ask what fee APR would exactly cancel the divergence loss:

breakEvenFeeApr
 = (hodl−pool)/V₀/yrs × 100
 = 252.55/10,000/(90/365)×100
 = 10.2424%

Below roughly 10.24% APR, this position would have been better off just holding the two assets. Above it, the pool wins. That single figure is more useful than the loss percentage itself, because it is directly comparable to the yield the pool is advertising.

The mistakes people make

Thinking it is temporary. The name says so, and it is only true if the relative price returns. Once you withdraw, the comparison is closed and the gap is realised. In most jurisdictions the withdrawal is also a disposal for tax purposes, which is a separate calculation and a separate article: the same sale can be a 49,910 gain or a 9,870 gain.

Assuming a stablecoin pair is exempt. Two assets that are supposed to hold the same value can still diverge, and when they do the ratio moves fast. A depeg is precisely the scenario where r moves a long way in a short time and where the pool has been buying the falling asset the whole way down.

Comparing the pool to cash instead of to holding. A pool position that is down 30% in a falling market has not necessarily suffered much divergence loss. Most of that is just the assets falling, which would have happened anyway. Divergence loss is the difference between the pool and holding, and it is the only part the pool is responsible for.

Reading a headline APR as a return. The advertised fee APR is usually annualised from recent volume, and volume is not stable. Working out the break-even yield tells you how much of that headline number you actually need to keep, which is a far more robust way to look at it than trusting the number itself.

Forgetting the costs outside the model. Gas for depositing and withdrawing, slippage on the way in and out, and — for any position involving reward tokens — the price of those tokens by the time you can sell them. None of these are in the arithmetic above.

What this does not model

Stated plainly, because the gap between a model and reality is where money goes:

  • Gas and transaction costs.
  • Slippage on deposit and withdrawal.
  • Incentive or reward token emissions, and their price when sold.
  • Compounding of fees back into the position.
  • Any pool that is not constant-product and equally weighted.
  • Smart contract risk, which is not an arithmetic quantity at all and cannot be priced by a calculator.

This is educational material, not financial advice. Providing liquidity carries risks — including total loss through smart contract failure — that no calculator can quantify.