DeFi Impermanent Loss Calculator
That 100% APY pool looks amazing until price divergence eats your principal. Calculate the real cost of providing liquidity and see whether fees actually cover your impermanent loss.
Token A
Token B
Pool & Reward Parameters
Impermanent Loss: The Complete Guide
Everything you need to know about impermanent loss in DeFi liquidity pools, how it works, and whether yield farming APY actually covers it.
Impermanent loss (IL) is the difference in value between holding tokens in a liquidity pool versus simply holding them in your wallet. It occurs because automated market makers (AMMs) like Uniswap, SushiSwap, and Curve constantly rebalance your position as token prices change, effectively selling the token that is rising and buying the token that is falling.
The mechanics work like this: AMMs use a constant product formula (x × y = k) to determine token prices. When external market prices move, arbitrageurs trade against the pool until the pool price matches the market price. This process changes the ratio of tokens you hold in the pool.
Why it is called “impermanent”:
- Reversible if prices return — If the prices of both tokens return to exactly where they were when you deposited, your impermanent loss goes back to zero. The loss only becomes permanent when you withdraw at different prices than when you deposited.
- Depends on divergence, not direction — IL depends on how much the prices of the two tokens diverge from each other, not on which direction they move. A 2x increase in one token relative to the other produces the same IL as a 0.5x decrease.
- Always negative (or zero) — The pool value is always less than or equal to the hold value. The only time there is zero IL is when both tokens have moved by the exact same percentage.
- Nonlinear and accelerating — IL grows slowly for small price changes but accelerates dramatically as divergence increases. A 2x price ratio causes only 5.7% IL, but a 5x ratio causes 25.5% IL.
Impermanent loss is the single most important risk factor for DeFi liquidity providers. High advertised APYs on yield farming protocols often exist precisely because they need to compensate LPs for the impermanent loss they are likely to suffer.
The impermanent loss formula comes directly from the constant product AMM model. For a standard 50/50 liquidity pool, the calculation follows these steps:
Step 1: Define the price ratio
Let r be the ratio of price changes between the two tokens. If Token A goes up 100% and Token B stays flat, then r = 2.0 / 1.0 = 2.0. If both go up 50%, then r = 1.5 / 1.5 = 1.0 (no IL).
Step 2: Apply the IL formula
IL(r) = 2 × √r / (1 + r) − 1
This formula gives you the percentage of value lost compared to holding. It is always zero or negative.
Step 3: Dollar amounts
- Hold value = original_amount_A × new_price_A + original_amount_B × new_price_B
- Pool value = 2 × √(k × new_price_A × new_price_B), where k = original_amount_A × original_amount_B
- IL in dollars = pool value − hold value
Common IL values by price ratio:
- 1.25x divergence = 0.6% IL (barely noticeable)
- 1.5x divergence = 2.0% IL (starts to matter)
- 2x divergence = 5.7% IL (significant for large positions)
- 3x divergence = 13.4% IL (painful)
- 5x divergence = 25.5% IL (devastating)
The key insight is that IL is symmetric around the 1:1 ratio. A token doubling (2x) and a token halving (0.5x) both produce 5.7% IL. This means that volatile trading pairs in both directions will accumulate IL.
Yes, in many cases trading fees and liquidity mining rewards can more than offset impermanent loss, making the net return from providing liquidity higher than simply holding. However, this depends on several critical factors and is not guaranteed.
When fees are likely to offset IL:
- High-volume pools — Pools with heavy trading volume generate more fees per dollar of liquidity. Major pairs like ETH/USDC on Uniswap can generate 10-30% APY from fees alone during volatile market periods.
- Stablecoin pairs — Pools pairing two stablecoins (USDC/DAI, USDT/USDC) have minimal price divergence and therefore near-zero IL, so almost all fee income is profit.
- Correlated assets — Pairs like stETH/ETH or WBTC/BTC tend to stay closely correlated, keeping IL low while still earning swap fees.
- Short time horizons with small moves — If prices diverge only slightly (under 1.5x), IL stays under 2%, which moderate fee APYs can easily cover.
When fees are unlikely to offset IL:
- Extreme price divergence — If one token goes 5x while the other stays flat, you need 25%+ APY just to break even. During crypto bull runs, many altcoin/ETH pairs see this level of divergence.
- Low-volume pools — New or obscure token pairs may have high advertised APY from reward tokens but generate very little in real trading fees. When rewards dry up, the real yield is negligible.
- Reward token depreciation — Many farming rewards are paid in the protocol’s native token, which often declines in value over time. A 100% APY paid in a token that drops 80% is really only a 20% APY.
The break-even calculation: To determine whether a pool is worth entering, calculate the minimum APY needed to offset IL at your expected price divergence. If the pool’s sustainable fee APY (not including temporary reward incentives) exceeds this break-even rate, the position is likely profitable.
Uniswap v3 introduced concentrated liquidity, which fundamentally changes how impermanent loss works compared to the v2 full-range model. The IL is amplified in concentrated positions, but so are the fee returns.
Uniswap v2 (full-range liquidity):
- Liquidity is spread across all possible prices from 0 to infinity
- IL follows the standard formula: 2√r / (1+r) − 1
- Your position never goes “out of range” — it always earns some fees regardless of price
- Capital efficiency is low because most of your liquidity sits at prices that will never be reached
Uniswap v3 (concentrated liquidity):
- You choose a price range (e.g., ETH between $2,500 and $3,500). Your capital is concentrated within that range, earning fees as if you had much more liquidity.
- Higher capital efficiency — A narrow range can earn 10–100x more fees per dollar of capital than v2, because all your capital is “active.”
- Amplified IL — The tighter your range, the more leveraged your position and the faster IL accumulates. If price exits your range, you hold 100% of the losing token (maximum possible IL for that range).
- Out-of-range risk — When price moves outside your chosen range, you stop earning fees entirely. You hold a single token and your position is fully impermanently lost relative to holding.
The tradeoff: Concentrated liquidity is like adding leverage to your LP position. You earn more fees per dollar, but you also take on more impermanent loss per dollar. The net outcome depends on whether the higher fees outpace the higher IL — and on active management of your price ranges.
This calculator uses the standard v2 full-range formula, which gives you a baseline understanding of IL. For v3 concentrated positions, the actual IL will be higher for the same price move if your range is tighter than the full range.
While you cannot eliminate impermanent loss entirely in a constant product AMM, there are several strategies to minimize its impact on your returns.
Pool selection strategies:
- Correlated pairs — LP in pairs where both tokens tend to move together. stETH/ETH, WBTC/BTC, or stablecoin/stablecoin pairs have minimal price divergence and therefore minimal IL.
- Stablecoin pools — USDC/DAI or USDT/USDC pools earn trading fees with effectively zero impermanent loss since both tokens maintain a $1 peg.
- High-volume pairs — Even if IL is present, high trading volume generates enough fees to compensate. Focus on pools where the sustainable fee APY (excluding temporary reward incentives) exceeds your expected IL.
Position management strategies:
- Shorter time horizons — The longer you stay in a pool with diverging prices, the more IL accumulates. Consider shorter farming periods during high-volatility markets.
- Active range management (v3) — In Uniswap v3, actively adjust your liquidity range as prices move to stay in range and earn fees. This requires attention and gas costs but can significantly reduce IL.
- Hedging with options — Advanced DeFi users can hedge impermanent loss by purchasing options on the volatile token. If the token moves sharply, the option gains offset the IL.
- Single-sided staking alternatives — Protocols like Lido, Rocket Pool, or lending platforms like Aave let you earn yield on a single token with zero impermanent loss. The APY is usually lower, but the return is more predictable.
Monitoring rules of thumb:
- Calculate the break-even fee rate before entering any pool
- If IL exceeds 30 days of fee income, re-evaluate the position
- Do not chase high APY without understanding why it is high — extreme APYs often exist to compensate for extreme expected IL or smart contract risk
The break-even fee rate is the minimum annual percentage yield (APY) from trading fees that a liquidity pool must generate for your return as an LP to match what you would have earned by simply holding the tokens in your wallet.
How it is calculated:
Break-even APY = (Hold Value − Pool Value) / (Initial Value × Time Fraction)
For example, if you deposit $10,000 into a pool for 12 months and the price divergence causes $570 in impermanent loss (a 2x price ratio), you need at least 5.7% APY from fees just to break even versus holding.
How to use the break-even rate:
- Compare to sustainable fee APY — Look at the pool’s historical fee APY (not including token rewards). If the sustainable fee APY is at least 2–3x the break-even rate, the position has a reasonable safety margin.
- Stress test with extreme divergence — Do not just calculate break-even for your base case price scenario. Also check what happens at 3x and 5x divergence. If the break-even rate at 3x divergence exceeds the pool’s fee APY, you are taking on significant tail risk.
- Account for reward token risk — If you are relying on reward token APY to cover IL, remember that reward tokens often depreciate. Calculate your break-even using only fee APY as the reliable income stream, and treat rewards as upside.
- Shorter time horizons increase break-even — If you are providing liquidity for only 3 months instead of 12, you need 4x the annualized APY to cover the same dollar amount of IL. Time works in your favor when fees are steady but prices diverge early.
The break-even fee rate is your single most important pre-entry check. Pools where the break-even rate exceeds historical fee APY under realistic price scenarios should be avoided regardless of advertised reward APY.
High APY numbers on DeFi yield farming dashboards are one of the most misunderstood metrics in crypto. There are several reasons why advertised APYs appear astronomically high, and why they rarely translate into actual realized returns.
Why APYs appear inflated:
- Reward token incentives — Most of the high APY comes from newly minted governance or reward tokens, not from trading fees. These tokens have selling pressure from all the farmers dumping them, causing the reward token price to decline. A 200% APY paid in a token that drops 90% over a year is really a 20% return.
- APY is based on current moment — DeFi dashboards calculate APY by annualizing the returns from the last 24 hours or 7 days. During a brief spike in trading volume, the annualized number can be enormous even though the spike will not last.
- TVL dilution — When a pool launches with farming incentives, early LPs earn huge APY because there is little total liquidity. As more capital floods in (chasing the APY), the yield per dollar drops rapidly. By the time most people enter, the APY is a fraction of what was advertised.
- IL is not included — Advertised APY numbers show gross yield from fees and rewards. They do not subtract impermanent loss. Your net return (after IL) can be dramatically lower or even negative.
- Compounding assumptions — Some dashboards show APY (with compounding) rather than APR (without). At high rates, the difference is significant: 100% APR with daily compounding is roughly 171% APY.
The reality check: Professional DeFi participants focus on sustainable fee APY (trading fees only, excluding rewards) as the true yield indicator. Reward tokens are treated as a bonus that may or may not retain value. Before entering any pool, calculate whether the fee-only APY exceeds your expected impermanent loss at realistic price divergence levels.
Stablecoin and same-peg pools are widely considered the safest way to earn yield from liquidity provision precisely because they minimize impermanent loss. However, they are not completely risk-free.
Stablecoin-to-stablecoin pools (e.g., USDC/DAI):
- Near-zero IL — Both tokens are pegged to $1, so the price ratio stays very close to 1:1. Normal minor deviations (0.999 to 1.001) produce essentially zero impermanent loss.
- Fee income is almost pure profit — Since IL is negligible, nearly all trading fee income goes directly to your bottom line.
- De-peg risk — The catastrophic scenario is a stablecoin losing its peg. If one stablecoin drops to $0.90 while the other holds at $1.00, the pool automatically fills your position with the de-pegging stablecoin. This is effectively a 10% price divergence, causing meaningful IL plus a direct loss on the de-pegged token.
Same-peg liquid staking pools (e.g., stETH/ETH):
- Low IL from staking rate drift — stETH accrues staking rewards, so it slowly diverges from ETH in value (upward). This creates small but persistent IL over long periods.
- De-peg risk is real — During the 2022 market crash, stETH temporarily traded at a significant discount to ETH. LPs in stETH/ETH pools experienced meaningful impermanent loss as the pool rebalanced toward stETH.
Curve Finance specialization: Curve uses a different AMM formula (StableSwap) optimized for assets that should trade near 1:1. This reduces IL even further for small deviations but still does not eliminate it during large de-peg events. Curve pools are generally the most capital-efficient way to LP stablecoins.
Stablecoin pools typically offer 2–8% APY from fees, which is modest compared to volatile pairs but is almost entirely real yield with minimal IL risk. They are the closest thing DeFi has to a “risk-free” yield (though smart contract risk always remains).
This is the central question every prospective LP should answer before depositing into a pool. The decision framework involves comparing your expected net return from LP (after IL, fees, and rewards) against your expected return from simply holding.
Provide liquidity when:
- You expect low price divergence — If you think both tokens will move roughly in tandem (or neither will move much), IL will be small and fees will dominate your return.
- The pool has high, sustainable trading volume — Not just reward APY, but real organic trading volume generating fees. Check historical fee data on platforms like DeFi Llama or Dune Analytics.
- You were going to hold both tokens anyway — If your plan was to hold equal-value amounts of ETH and USDC regardless, providing liquidity earns you additional income from fees. The IL is the same as the rebalancing you would have done manually.
- The break-even fee rate is well below actual fee APY — If your worst-case price divergence scenario still produces a break-even rate lower than the pool’s historical fee APY, the risk/reward is favorable.
Just hold when:
- You are bullish on one token specifically — If you think ETH will 5x but USDC will stay flat, providing ETH/USDC liquidity means the pool will sell your ETH as it rises. You would be better off just holding ETH.
- Volatility is expected to be extreme — During major market events (new protocol launches, macro shocks, token unlocks), price divergence can spike far beyond normal levels.
- The APY is primarily from reward tokens — If 90% of the advertised APY comes from a governance token that is being farmed and dumped, the sustainable yield is much lower than it appears.
- Smart contract risk is high — New or unaudited protocols carry risk of exploits. No yield is worth losing your entire position to a hack.
The decision checklist:
- Calculate IL at your expected and worst-case price scenarios
- Compare break-even fee rate to historical sustainable fee APY
- Assess reward token sustainability and selling pressure
- Check smart contract audit status
- Factor in gas costs for entry, exit, and harvesting
Impermanent loss is the most discussed risk of liquidity provision, but it is far from the only one. Smart contract risks can result in total loss of deposited funds, making them arguably more important to evaluate.
Major smart contract risks:
- Protocol exploits and hacks — DeFi protocols have lost billions of dollars to smart contract exploits. Flash loan attacks, reentrancy bugs, oracle manipulation, and logic errors can drain pools entirely. Even audited protocols are not immune.
- Rug pulls — Malicious developers can create pools with back doors that allow them to drain liquidity. This is especially common with new, unaudited tokens on decentralized exchanges.
- Oracle manipulation — Some pools rely on external price oracles. If an attacker can manipulate the oracle, they can drain value from the pool by trading at artificial prices.
- Admin key risk — Many DeFi protocols have admin keys or governance mechanisms that can change pool parameters, fee structures, or even pause withdrawals. If these keys are compromised or misused, LP funds are at risk.
- Token contract risk — Even if the AMM contract is safe, the tokens themselves may have vulnerabilities. Tokens with transfer taxes, rebasing mechanics, or blacklist functions can behave unexpectedly in pools.
How to assess smart contract risk:
- Check audit reports — Use only protocols audited by reputable firms (Trail of Bits, OpenZeppelin, Certora). Multiple audits are better than one.
- Time-tested protocols — Uniswap, Curve, and Aave have billions in TVL and years of operation without critical exploits. Newer protocols carry more unknown risk.
- Bug bounty programs — Protocols with active, well-funded bug bounties incentivize white-hat hackers to find and report vulnerabilities before they are exploited.
- Diversify across protocols — Do not concentrate all your LP positions in a single protocol. If one is exploited, you lose only a portion of your capital.
Remember: the highest APYs in DeFi are often on the newest and least-tested protocols. The risk-adjusted return of a 5% APY on Uniswap may be higher than a 200% APY on an unaudited protocol that could lose 100% of your funds overnight.
Ready to value the tokens behind your liquidity positions?