Providing Liquidity to a DeFi Pool Can Lose You Money Even While Both Prices Go Up. Here's the Impermanent Loss Math
8 min read
8 min read
You put two tokens into a DeFi liquidity pool. Six months later, both tokens are worth more in dollars than when you deposited them. You should be ahead. Instead, you check your position and it is worth less than if you had simply held both tokens in your wallet and done nothing.
That gap has a name: impermanent loss. It is not a fee, a hack or a scam. It is a direct, predictable side effect of how a specific kind of DeFi pool works, and you can calculate it exactly before it happens to you.
A liquidity pool is a pair of tokens locked in a smart contract, used to let other people trade one for the other without a traditional buyer and seller matching up directly. You deposit both tokens in the pair, usually in equal dollar value, and traders swap against your combined balance. In exchange, you earn a small fee on every trade that passes through the pool.
The most common design, used by Uniswap and most of its competitors, is called a constant product pool. It holds the two token balances so that multiplying them together always gives the same number. If nobody deposits or withdraws, that product cannot change, only the split between the two tokens can.
That single rule, multiply and hold steady, is the entire cause of impermanent loss.
When a trader buys Token A from the pool with Token B, the pool's Token A balance goes down and its Token B balance goes up, automatically, following the constant-product rule. The pool has no opinion about whether Token A is a good buy right now. It just keeps the product of the two balances fixed.
The practical effect is that as Token A's price rises relative to Token B, the pool automatically sells some of your Token A into the market and holds more Token B instead. As Token A's price falls, the pool buys more of it back. The pool is always selling whichever token just went up and buying whichever token just went down, on your behalf, whether you wanted that trade or not.
That mechanical rebalancing is why impermanent loss can happen even when every token in the pool is rising in dollar terms. What matters is not whether prices went up. What matters is whether the ratio between the two token prices moved, because that ratio is what decides how much of each token the pool ends up holding.
Say you deposit 1 unit of Token A and 1 unit of Token B into a pool, each worth $10, for $20 total. Over the next few months, Token A triples to $30 and Token B rises 50% to $15. Both went up. Nobody lost money on paper, on either token individually.
If you had just held both tokens in your wallet, they would now be worth $30 + $15 = $45.
Because you supplied them to a constant-product pool instead, the pool automatically sold some of your Token A into the market as it rose (to keep the product balanced) and used the proceeds to hold more Token B. The result, using the standard constant-product formula below, is a position worth $42.43, a $2.57 shortfall, roughly 5.72% less than simply holding, even though both tokens finished higher than where you started.
| Just holding | In the liquidity pool | |
|---|---|---|
| Token A price | $10 → $30 | $10 → $30 |
| Token B price | $10 → $15 | $10 → $15 |
| Position value | $45.00 | $42.43 |
| Result vs holding | (baseline) | −5.72% (impermanent loss) |
Nothing was stolen and nothing was hacked. The pool did exactly what a constant-product pool is designed to do: it sold the token that outperformed and bought more of the one that lagged behind, automatically, the entire time you were deposited.
The impermanent loss for a standard 50/50 constant-product pool follows one formula, where r is how much the price ratio between the two tokens has moved since you deposited (the new price of Token A divided by Token B's price, divided by that same ratio on the day you deposited):
Impermanent loss = 2 × √r ÷ (1 + r) − 1
Plug in the worked example above: Token A tripled while Token B rose 50%, so the price ratio between them doubled (r = 2). That formula gives 2 × √2 ÷ 3 − 1 ≈ −5.72%, exactly matching the dollar shortfall above. The formula does not care that both prices rose. It only cares that the ratio between them changed by a factor of 2.
That ratio-only behavior is also why impermanent loss is symmetric: a token's price relative to its pair doubling (r = 2) and that same relative price being cut in half (r = 0.5) produce the identical 5.72% loss. Direction does not matter. Divergence does.
| Price ratio moves by | Impermanent loss |
|---|---|
| 1.25× | −0.6% |
| 1.5× | −2.0% |
| 2× | −5.7% |
| 3× | −13.4% |
| 4× | −20.0% |
| 5× | −25.5% |
The loss accelerates faster than the price ratio does. A ratio moving 2× costs 5.7%, but a ratio moving 5×, only two and a half times further, costs more than four times as much. The wider the two tokens in a pool drift apart in price, the harder that math bites, which is exactly why pools pairing two highly correlated assets (two stablecoins, or a token against its own wrapped version) see far less of this effect than a pool pairing two tokens that move independently of each other.
The loss is called impermanent because it only becomes a real, locked-in loss once you withdraw your tokens from the pool. If the price ratio between the two tokens moves back to where it was when you deposited, the loss disappears on its own, with no action needed from you. If the ratio never recovers, or you withdraw while it is still diverged, the loss is realized and permanent for you, the same as any other paper loss that gets locked in the moment you sell.
Every trade through a pool pays a fee to whoever supplied that liquidity, which is the actual reason to provide liquidity at all despite this risk. Uniswap v3, the design most competitors have copied, offers four fee tiers: 0.01% and 0.05% for pairs expected to trade close to 1:1 (two stablecoins, for example), 0.3% as the standard tier for pairs with normal price movement, and 1% for newly launched or thinly traded tokens, according to Uniswap's own documentation.
Whether accumulated fees outweigh a given pool's impermanent loss depends entirely on how much trading volume that specific pool sees relative to how far its two tokens' prices drift apart, which varies pool by pool and cannot be assumed in either direction. A high-volume pool between two correlated tokens can comfortably out-earn a small impermanent loss. A low-volume pool between two tokens that diverge sharply usually cannot. Check a pool's own recent volume and fee tier before assuming the fee side of that trade covers the loss side.
The wider two tokens are likely to drift apart in price, the bigger this math gets. Before depositing into any pool, look at how independently the two tokens have actually moved. NetWort's Explore screener lets you compare volatility across assets side by side, a faster way to gauge how much two tokens' prices might diverge than assuming they will move together because they are both "crypto." ETH and UNI, the token behind the AMM design this math describes, are two assets worth checking there before pairing anything with them in a pool. If you are weighing pool liquidity against a simpler DeFi yield source, DeFi lending works on a completely different mechanism, a lending pool rather than an automated market maker, and does not carry this specific risk at all.