How to use the impermanent loss calculator
- Choose how to describe the price move. “Token prices” takes the dollar price of each token at deposit and now. “Price change of A against B” needs only the percentage change in their price ratio; it treats token B as constant in dollars, which suits stablecoin pairs.
- Enter the prices at the time you deposited and today, or the change you want to test. The example is a fictional token A that rises from $10 to $15 against a stablecoin worth $1.
- Enter the deposit value, the dollar value you added to the pool, split equally between the two tokens.
- Enter the fee APR and the days in the pool. The fee APR is the yearly rate of trading fees paid to liquidity providers, usually shown on the pool’s page. It changes with trading volume, so treat it as an estimate.
The results compare the pool with simply holding the tokens. The chart shows impermanent loss across the full range of price moves, and the table lists the loss and the fee rate needed to offset it at common price changes.
The impermanent loss formula
In a constant-product pool, the number of tokens satisfies x × y = k. As traders buy one token and sell the other, the pool’s mix shifts so that the value of each side stays equal. The result, compared with holding, depends only on how much the price ratio changed:
Impermanent loss = 2√r ÷ (1 + r) − 1r is the change in the price of token A measured in token B. r = 1 means no change and no loss.
The dollar values follow from the price multiples a = PA, now ÷ PA, deposit and b = PB, now ÷ PB, deposit:
Value in pool = Deposit × √(a × b)
Fees = Deposit × Fee APR × Days ÷ 365
Net versus holding = Value in pool + Fees − Value if heldFees are estimated as simple interest on the deposit, which keeps the result easy to check. Real fees accrue on the changing pool value.
A worked example
You deposit $10,000 into a pool: half in token A at $10 and half in a stablecoin at $1. Token A then rises to $15, a 50% move.
Had you held the tokens, they would be worth $12,500.00. In the pool, arbitrage traders have bought some of your token A along the way, so you now have 408.2483 token A and 6,123.7244 stablecoins, worth $12,247.45. The impermanent loss is 2.02%, or $252.55.
Over 90 days at a 15% fee APR, the position earns about $369.86 in fees, so the pool ends $117.31 ahead of holding. The break-even fee rate for this move over this period is 10.24%.
Your position is still up +26.17% on the deposit. Impermanent loss does not mean losing money in absolute terms; it means earning less than you would have by doing nothing.
How much loss for how much price change
The loss grows with the size of the divergence, slowly at first and then quickly:
| Change in A against B | Impermanent loss | Change in A against B | Impermanent loss |
|---|---|---|---|
| −25% | -1.03% | +25% | -0.62% |
| −50% | -5.72% | +100% | -5.72% |
| −75% | -20.00% | +300% | -20.00% |
| −90% | -42.50% | +500% | -30.01% |
Two patterns stand out. First, moves of a similar size in ratio terms cost the same whichever direction they go: halving the ratio costs exactly as much as doubling it, because both are a factor of two. Second, small moves cost very little. A 25% move either way costs about 1% or less, which ordinary fee income can often cover. When the ratio triples, the loss reaches 13.40%, and a fee APR high enough to offset that within a few months is rare.
Only the ratio matters
Impermanent loss depends on the relative price of the two tokens, not on whether the market went up. If token A and token B both rise by 50%, the ratio is unchanged and the loss is 0.00%, even though the position gained a lot in dollars. That is why pairs of assets that tend to move together, such as two stablecoins or two versions of the same asset, have little impermanent loss, while a volatile token paired with a stablecoin has the most.
Fees versus impermanent loss
Whether providing liquidity beats holding comes down to a race between the fees you collect and the divergence in prices. Time works for the fees: the longer you stay, the more they accumulate, while the impermanent loss depends only on where prices end up. In the example, staying a full year would earn $1,500.00 in fees and put the pool $1,247.45 ahead of holding, if prices ended at the same level.
Two cautions apply. A pool’s quoted fee APR is backward-looking and can fall sharply when trading volume dries up or more liquidity arrives. And volatile pairs, which pay the highest fees, are exactly the ones most likely to diverge a lot.
Concentrated liquidity
The formula here describes full-range liquidity, the classic constant-product design used by Uniswap v2 and its forks. Concentrated liquidity pools, such as Uniswap v3, let you choose a price range. Within that range your capital works harder, earning more fees per dollar, but the impermanent loss for a given price move is larger too. If the price moves outside your range, your position becomes entirely the token that fell in relative terms and stops earning fees until the price returns. This calculator understates the loss for a concentrated position.
What this calculator does not include
- Concentrated liquidity ranges and weighted pools (such as 80/20 pools), which follow different formulas.
- Fee compounding and volume changes. Fees are a simple rate on the deposit over the period.
- Gas costs for depositing, claiming and withdrawing, which can matter for small positions.
- Smart contract, depeg and rug-pull risks, which can cost far more than impermanent loss.
- Liquidity mining rewards paid in extra tokens, and their own price risk.
- Taxes. Depositing into or withdrawing from a pool may be treated as a taxable exchange in the US; the rules for liquidity positions are not settled in detail, so records of each step help.