The Standard Engine.
MathematicsFinanceHealthPhysicsEngineeringBrowse all

Finance & Economics · Quantitative Trading & Crypto · Crypto & DeFi

Impermanent Loss Calculator

Calculates the impermanent loss experienced by a liquidity provider in a constant-product AMM pool when the price ratio of the two assets changes.

Calculator

Advertisement

Formula

IL is the impermanent loss expressed as a fraction of the hold value (negative means a loss). r is the price ratio change, defined as r = P_1 / P_0, where P_0 is the initial price of asset A relative to asset B and P_1 is the final price. When r = 1 (no price change), IL = 0. The formula is derived from the constant-product invariant x · y = k used by Uniswap-style AMMs.

Source: Uniswap V2 whitepaper; Pintail (2019) 'Uniswap — A Good Deal for Liquidity Providers?' — widely cited DeFi derivation.

How it works

What is Impermanent Loss? When you deposit two assets into a constant-product AMM pool (governed by the formula x · y = k), the pool automatically rebalances whenever the market price of one asset changes. If asset A doubles in price relative to asset B, arbitrageurs will drain asset A from the pool until the pool price matches the market price. As a result, your share of the pool contains less of the now-expensive asset and more of the cheaper one — you are effectively selling into strength and buying into weakness at every price move. The resulting shortfall compared to a simple hold strategy is called impermanent loss.

The Formula The impermanent loss fraction is given by IL = 2√r / (1 + r) − 1, where r = P₁ / P₀ is the ratio of the final price to the initial price of one asset relative to the other. This formula is derived analytically from the constant-product invariant and is exact for 50/50 two-asset pools. The loss is always negative (or zero when r = 1) and is symmetric: a price increase by factor r causes the same IL as a price decrease to 1/r. Key thresholds to remember: a 2× price change causes approximately −5.72% IL; a 5× change causes −25.46% IL; a 10× change causes −42.46% IL.

Practical Importance Impermanent loss is called 'impermanent' because if prices return to their original ratio, the loss disappears. However, in practice prices rarely revert perfectly, making the loss permanent upon withdrawal. LPs must earn sufficient trading fee revenue to offset this loss and turn a profit. Stablecoin-to-stablecoin pools (e.g., USDC/DAI) have near-zero impermanent loss because price ratios barely change. Volatile asset pairs (e.g., ETH/USDC) can suffer severe IL during bull or bear markets. Sophisticated DeFi investors always model expected IL against projected fee income before committing capital.

Worked example

Scenario: You deposit $10,000 into a 50/50 ETH/USDC liquidity pool when ETH is priced at $1,000. This means you deposit 5 ETH and 5,000 USDC. Later, ETH rises to $2,000.

Step 1 — Compute the price ratio: r = 2,000 / 1,000 = 2.0

Step 2 — Compute IL fraction: IL = 2 × √2 / (1 + 2) − 1 = 2 × 1.41421 / 3 − 1 = 2.82843 / 3 − 1 = 0.94281 − 1 = −0.05719 (i.e., −5.72%)

Step 3 — Compute HODL value: If you had simply held 5 ETH + 5,000 USDC, your portfolio would be worth 5 × $2,000 + $5,000 = $10,000 + $5,000 = $15,000.

Step 4 — Compute LP position value: After rebalancing, the pool holds approximately 3.536 ETH and 7,071 USDC per original $10,000 deposit. Value = 3.536 × $2,000 + $7,071 = $7,071 + $7,071 = $14,142.

Step 5 — Compute IL in USD: $14,142 − $15,000 = −$858. Your LP position is worth $858 less than if you had just held the assets. To be profitable as an LP, you need to have earned more than $858 in trading fees during this period.

Limitations & notes

This calculator applies strictly to constant-product (x · y = k) 50/50 AMM pools such as Uniswap V2 and early Sushiswap. It does not account for concentrated liquidity positions (Uniswap V3), where IL behaves differently and can be amplified within the chosen price range. It does not model Curve's stableswap invariant or Balancer's weighted pools with non-50/50 splits. The calculator also ignores trading fee income, which is the primary mechanism by which LPs recoup impermanent loss — real profitability requires fee APY data. Gas costs for depositing and withdrawing are not included. The formula assumes perfect arbitrage and continuous rebalancing; in practice, discrete trades mean actual pool composition may deviate slightly. Finally, the loss is only 'realised' when you withdraw; if prices revert to the original ratio before withdrawal, IL is zero.

Frequently asked questions

Why is impermanent loss called 'impermanent'?

The loss is called impermanent because it only becomes realised (permanent) when you withdraw your liquidity. If the price ratio between the two assets returns exactly to the initial ratio at the time of your deposit, the impermanent loss is fully reversed and equals zero. The term was coined to distinguish this unrealised book loss from a definitive capital loss — though in volatile crypto markets, prices rarely revert perfectly, making it effectively permanent for most LPs.

How much impermanent loss does a 2x price change cause?

A 2× price change (either up or down) in one asset relative to the other causes approximately −5.72% impermanent loss. This means your LP position is worth about 5.72% less than if you had simply held the two assets in your wallet. The loss is symmetric: ETH going from $1,000 to $2,000 causes the same IL percentage as ETH dropping from $1,000 to $500 (a 0.5× ratio).

Can trading fees offset impermanent loss?

Yes — trading fees are the primary reason LPs accept impermanent loss risk. For example, Uniswap V2 charges a 0.3% fee per swap, all of which goes to LPs proportionally. High-volume pairs like ETH/USDC can generate substantial fee APY. Whether fees offset IL depends on trading volume, fee tier, and price volatility. Stablecoin pools with low IL but decent volume (e.g., on Curve) are often the most reliably profitable for LPs.

Does impermanent loss apply to Uniswap V3 concentrated liquidity?

The same underlying mechanics apply to Uniswap V3, but IL is amplified within a concentrated liquidity range. Because V3 LPs concentrate capital over a narrow price band, they earn higher fees — but if the price moves outside their range, they are 100% exposed to one asset and their IL can be significantly larger than in a V2-style full-range position. The formula in this calculator is not directly applicable to V3 positions.

What is the maximum possible impermanent loss?

In theory, impermanent loss approaches −100% if one asset's price drops to zero relative to the other (r → 0 or r → ∞). As r → ∞, the formula yields IL → −100%, meaning your LP position converges to being entirely composed of the worthless asset. In practice, IL of 50%+ is possible for extremely volatile pairs with 10× or greater price moves. This is why many experienced DeFi participants avoid providing liquidity for pairs with highly asymmetric volatility profiles.

Last updated: 2025-01-15 · Formula verified against primary sources.