Home / How to Calculate Impermanent Loss in DeFi Liquidity Pools

How to Calculate Impermanent Loss in DeFi Liquidity Pools

How to Calculate Impermanent Loss in DeFi Liquidity Pools

When you provide liquidity to a DeFi pool, you’re not just earning trading fees-you’re also taking on a hidden risk called impermanent loss. It’s not a loss you can see in your wallet right away. It’s the gap between what your liquidity position is worth and what you’d have if you’d just held the tokens in your pocket. This gap opens up when the price of one token in the pair moves significantly compared to the other. And if you withdraw your funds while that gap exists, it becomes real.

Why Impermanent Loss Happens

Impermanent loss isn’t caused by hackers or smart contract bugs. It’s built into the math of automated market makers (AMMs) like Uniswap, Sushiswap, and Curve. These platforms use a simple rule: the product of the two token amounts in a pool must stay constant (x * y = k). So if the price of ETH rises, the pool automatically sells some ETH and buys USDC to keep that product balanced. That’s how arbitrage traders make money-and how liquidity providers lose out.

Imagine you deposit 1 ETH and 1,600 USDC into a pool when ETH is $1,600. Your total value is $3,200. Now ETH goes to $2,000. A trader notices the pool still has ETH priced at $1,600 (because it hasn’t adjusted yet), so they buy ETH from the pool at the lower price. The pool gives them ETH and gets USDC in return. By the time the price settles at $2,000, the pool has less ETH and more USDC than when you deposited. Your share of the pool is now worth less than if you’d just held both tokens.

The Basic Formula for 50/50 Pools

For the most common type of liquidity pool-50% token A, 50% token B-the formula is straightforward:

Impermanent Loss = 2 × √d / (1 + d) - 1

Where d is the price ratio change. You calculate d by dividing the initial price by the current price.

Let’s say ETH was $1,600 when you deposited and is now $2,000.

  • d = 1600 / 2000 = 0.8
  • √0.8 = 0.8944
  • 2 × 0.8944 = 1.7888
  • 1 + 0.8 = 1.8
  • 1.7888 / 1.8 = 0.9938
  • 0.9938 - 1 = -0.0062

That’s a -0.62% impermanent loss. You didn’t lose money in absolute terms-you still have more USDC than before. But you’re 0.62% worse off than if you’d just held ETH and USDC separately.

What Happens at Bigger Price Moves?

The bigger the price swing, the worse the loss. Here’s what you can expect with a 50/50 pool:

  • 1.25x price change → 0.6% loss
  • 2x price change → 5.7% loss
  • 3x price change → 13.4% loss
  • 4x price change → 20.0% loss
  • 5x price change → 25.5% loss

That’s why providing liquidity to pairs like ETH/USDC during a bull run can be risky. If ETH goes from $2,000 to $10,000, you’re looking at over 25% impermanent loss. But here’s the catch: you’re also earning trading fees. If ETH trades heavily during that rise, those fees can cover-or even exceed-the loss.

Farmer holds USDC carrots as an ETH rabbit escapes over a collapsed pool fence labeled '25.5% Loss'.

What About Non-50/50 Pools?

Not all pools are equal. Some are weighted 80/20, 90/10, or even 99/1. These are common in stablecoin pools or when a token is highly volatile. The formula changes:

Impermanent Loss = (2 × √(d^w × (1-w)^(1-w))) - (d^w + (1-w)^(1-w))

Where w is the weight of the first asset (e.g., 0.8 for an 80/20 pool).

For example, in an 80/20 ETH/USDC pool where ETH goes from $1,600 to $2,000 (d = 0.8):

  • d^w = 0.8^0.8 = 0.8365
  • (1-w)^(1-w) = 0.2^0.2 = 0.7248
  • √(0.8365 × 0.7248) = √0.6063 = 0.7787
  • 2 × 0.7787 = 1.5574
  • 0.8365 + 0.7248 = 1.5613
  • 1.5574 - 1.5613 = -0.0039 → -0.39% loss

Notice something? The loss is smaller than in a 50/50 pool. That’s because you’re exposed to less of the volatile asset. But here’s the trade-off: your potential fee earnings are also lower, since you’re providing less of the token traders are buying and selling.

Uniswap v3 and Concentrated Liquidity

Uniswap v3 changed everything. Instead of spreading your liquidity across all price ranges, you pick a range-say, $1,800 to $2,200 for ETH. Your capital is only active within that range. That means:

  • If ETH stays inside your range, you earn more fees per dollar than in v2.
  • If ETH moves outside your range, you stop earning fees and your entire position turns into just one token (e.g., all USDC if ETH drops below $1,800).

That makes impermanent loss more extreme. If ETH surges past $2,200, your entire position becomes USDC. You’re no longer participating in ETH’s upside. Your impermanent loss isn’t just a percentage-it’s a complete loss of exposure.

Studies show that narrow-range positions in v3 can suffer 38% more impermanent loss than equivalent v2 positions during price moves outside the range. But within the range, you can earn 2-5x more fees. It’s a high-risk, high-reward trade-off.

Stablecoin Pools Are Different

Curve and other stablecoin AMMs use a different math. Instead of x*y=k, they use x+y=k. This keeps the price of stablecoins tightly pegged. Even if USDC moves from $1.00 to $1.01, the pool adjusts without triggering large impermanent loss.

For price changes under 10%, Curve pools often show less than 0.1% impermanent loss. That’s why most professional liquidity providers put their stablecoins in Curve, and their volatile assets in Uniswap v3 with carefully chosen ranges.

Uniswap v3 hero stranded on a narrow price bridge as ETH zooms past, while Curve pool glows peacefully below.

Are Fees Enough to Cover the Loss?

This is the real question. A pool might offer 50% APY in fees. Sounds great-until you realize ETH jumped 4x and your impermanent loss is 20%. You’re still down.

Here’s what real users saw:

  • One user deposited $1,000 in ETH/USDC at $2,000 ETH. When ETH hit $3,000, their impermanent loss was 10.2%. But after six months of fees, they ended up with a net 3.7% gain.
  • Another user provided liquidity to a new token pair. ETH went from $1,500 to $6,000. Impermanent loss: 38.7%. Fees earned: 12.3%. Net loss: $4,200.

There’s no universal answer. You need to estimate:

  1. How big the price move might be
  2. How often the pair trades
  3. How much fee income you’ll earn over time

Use tools like the CoinGecko Impermanent Loss Calculator or Zapper.fi to simulate scenarios. But always remember: these tools don’t include fees. You have to add them manually.

How to Avoid Getting Hurt

Here’s what works in practice:

  • Stick to stablecoin pairs if you want low risk. Curve, Balancer stable pools.
  • Use Uniswap v3 with wide ranges if you’re bullish on ETH or BTC. Don’t pick tight ranges unless you’re actively managing.
  • Avoid new, low-volume tokens. They’re volatile and trade little. Fees won’t save you.
  • Track your position with DeBank or Zapper. They show real-time impermanent loss vs. holding.
  • Use the 10% rule: If one token moves more than 10% in a week, consider rebalancing or withdrawing.

And here’s a quick mental shortcut for 50/50 pools: if a token goes up by x%, your impermanent loss is roughly (1 - √(x/100 + 1)) × 100. So if ETH goes up 100% (doubles), plug in 100: (1 - √2) × 100 ≈ (1 - 1.414) × 100 = -41.4%. Wait-that’s wrong. The correct shortcut is: if a token doubles, loss ≈ 5.7%. The formula above doesn’t work for percentage increases-it’s for price ratios. Stick to the real formula or use a calculator.

Final Reality Check

Impermanent loss isn’t a bug. It’s a feature. It’s how AMMs keep prices aligned with the market. The real risk isn’t the math-it’s misunderstanding it. Many people panic when they see a 10% impermanent loss and pull out, only to watch the token go up 50% afterward.

As Vitalik Buterin said, it’s better to think of it as a divergence loss. You’re not losing money-you’re missing out on the opportunity to hold both assets as they move apart.

The best liquidity providers don’t chase high APYs. They pick pairs with steady trading volume, avoid extreme volatility, and let fees compound over time. They know that in DeFi, patience beats speculation.

Is impermanent loss real money I lose?

No-not until you withdraw. Impermanent loss is the difference between your liquidity position’s value and what you’d have if you held the tokens outside the pool. If prices return to their original ratio, the loss disappears. But if you pull out while prices are apart, it becomes permanent.

Can I avoid impermanent loss entirely?

Not if you’re providing liquidity to volatile token pairs. But you can minimize it. Use stablecoin pools (like USDC/USDT on Curve), choose wide price ranges on Uniswap v3, or avoid pools with tokens that have high price swings. Some new tools even auto-rebalance your position to reduce exposure.

Do fees always offset impermanent loss?

No. Fees only offset loss if trading volume is high enough. In 2023, CoinGecko found only 27% of DeFi liquidity pools generated enough fees to cover typical impermanent loss. For volatile pairs with low volume, fees are often too small to matter.

Why does Uniswap v3 have higher impermanent loss risk?

Because you concentrate your liquidity into a narrow price range. If the price moves outside that range, your entire position turns into one token. You lose exposure to the asset’s upside, and your loss becomes much larger than in Uniswap v2, where your funds are spread across all prices.

Should I use a calculator or do the math myself?

Use a calculator for quick estimates-tools like CoinGecko’s or Zapper.fi are reliable. But if you’re managing large positions, build a spreadsheet that includes both impermanent loss and projected fees. Real decisions need both numbers.

Is impermanent loss the same as slippage?

No. Slippage is the difference between the price you expect and the price you get when you trade. Impermanent loss is the opportunity cost you face as a liquidity provider when token prices change relative to each other. They’re related but different concepts.

What happens if both tokens go up?

If both tokens rise equally, there’s no impermanent loss. The ratio stays the same, so the pool doesn’t need to rebalance. But if one rises faster than the other, you get loss-even if both are going up.

Can I get taxed on impermanent loss?

In most jurisdictions, you’re not taxed on impermanent loss because no actual sale has occurred. But if you withdraw and sell tokens, you may owe capital gains tax on the profit or loss from that sale. Always check your local tax rules.

1 comment

george haris

george haris

Man, I just got into DeFi last month and this post broke it down so simply. I thought impermanent loss was some scammy term they made up to scare people. Turns out it’s just math being weird. I’m now using Zapper to track my LP positions and it’s a game changer. No more guessing.

Write a comment