QuantCalcs/tools

Tools › Impermanent loss calculator

Impermanent Loss Calculator

See your impermanent loss, compare LPing against simply holding, and find the fee APR a pool must pay for the position to break even.

Total, split 50/50 across both assets.
2 = doubled, 0.5 = halved.
Use 1 for a stablecoin.
Optional — compare against the pool’s actual yield
Trading-fee yield the pool pays, annualised.
Impermanent loss
0.00%
If you had simply held
LP position (before fees)
Fees earned
LP position + fees
Breakeven fee APR
The workingthe breakeven APR, derived

Where LPing beats holding

Both curves as the price ratio moves. The shaded band is where fees more than cover the loss.

LP position plus fees compared with simply holding Two curves plotted against the price ratio. Where the LP curve sits above the holding curve, providing liquidity is ahead.
LP + fees Simply holding LP ahead
Ad slot · replace with AdSense unit after approval

What impermanent loss actually is

When you provide liquidity to a 50/50 pool, the pool automatically sells whichever asset is rising and buys whichever is falling. If the two prices drift apart, you end up holding less of the winner and more of the loser than if you had just kept both coins in your wallet. That shortfall is impermanent loss. It depends only on how far the prices diverge — not on which one moved, and not on the size of your deposit.

r  =  (A price change) ÷ (B price change)
IL  =  2√r / (1 + r) − 1
LP value  =  deposit × √r     HODL value  =  deposit × (r + 1) / 2

Because IL depends on the ratio, doubling (r = 2) and halving (r = 0.5) both cost the same 5.72%.

The number most calculators leave out: breakeven APR

Impermanent loss on its own tells you almost nothing about whether to LP — fees are the whole point of providing liquidity. The useful question is: how much fee income does this pool need to pay before LPing beats holding?

required fee yield  =  1 / (1 + IL) − 1
breakeven APR  =  required fee yield × 365 / days

One subtlety worth stating, because it is easy to get wrong: fees accrue on the LP position value, not on your original deposit. Since the position is worth less than the deposit once prices diverge, using the deposit overstates the fees you actually collect. This calculator applies fees to the position.

Note the time dependence: the same 5.72% loss needs about a 25% APR to break even over 90 days, but roughly 316% over a single week — a short, violent move is far harder to out-earn than a slow drift.

The chart above makes a point the single figure hides: LPing wins inside a band, not everywhere. Fees are pure profit when prices barely move, but impermanent loss grows faster than fee income as the ratio runs away, so there is a price move in each direction beyond which holding wins. Solving for where the two curves cross gives the edges of that band, and they are marked on the chart. If you expect the ratio to leave the band, the pool’s APR is not the number that matters.

What this excludes

This models a constant-product 50/50 pool of the Uniswap-v2 type. Concentrated-liquidity positions (Uniswap v3 and similar) amplify both fees and losses within their range and can end up entirely in one asset, so their outcome will be worse than this figure when price leaves the range. Gas costs, token incentives, and any rebalancing you do are also excluded, and the fee APR is treated as constant when real pool yields move with volume.

Questions

How is impermanent loss calculated?

For a 50/50 constant-product pool, impermanent loss depends only on how much the two asset prices diverge. If r is the ratio of their price changes, the loss versus simply holding is 2 times the square root of r, divided by one plus r, minus one.

What fee APR do I need to break even?

Enough fee income to cancel the impermanent loss over your holding period. Because fees accrue on the position value rather than your original deposit, the required yield is one divided by one plus the impermanent loss, minus one, annualised over the days you stay in the pool.

Is impermanent loss really impermanent?

Only if prices return to their starting ratio. If you withdraw while prices have diverged, the loss is realised and permanent. The name refers to the fact that the loss reverses if the price ratio comes back.

Risk note. Providing liquidity exposes you to price risk, smart-contract risk, and losses that fees may not cover. These figures are estimates for education and planning, not financial advice. Check the pool’s own numbers before committing funds.

How this was verified

The formulas above are not taken on trust. A script simulates a constant-product pool from first principles — tracking the two token balances through the price move under the x·y=k invariant — and checks that the closed forms reproduce the simulated position value exactly. The breakeven APR is checked twice over: once against the closed form, and once by solving for it numerically with bisection, so the two must agree independently.

It also pins the invariants: impermanent loss matches published reference values (5.72% at 2×, 25.46% at 5×), a doubling and a halving cost the same, no price divergence means no loss, a shorter hold demands a higher breakeven APR, and charging fees against the deposit rather than the position lands on the wrong verdict.

You can run it yourself: verification/impermanent_loss.py.

Open method: the formulas are shown above, the checks are public, and the full source is on GitHub — verify it at github.com/yjquant/calc-tools. Corrections welcome via hello@quantcalcs.com.