How DeFi Yield / Impermanent Loss Calculator Works
Our free DeFi yield calculator solves the biggest problem in decentralized finance: displayed APYs are misleading. When a liquidity pool shows 50% APY, your actual return could be anywhere from -20% to +80% depending on price movements, impermanent loss, gas costs, and compounding frequency. This tool calculates your real return.
The impermanent loss (IL) calculation is the core feature. When you provide liquidity to an automated market maker (AMM) like Uniswap, price divergence between your two tokens causes your position to be worth less than simply holding. The math is precise: IL = 2 × sqrt(price_ratio) / (1 + price_ratio) − 1. A 2x price move causes 5.7% IL. A 5x move causes 25.5% IL. These losses compound quickly and are often larger than the fees earned.
You enter your initial position (token amounts and prices), expected final prices, the pool's trading fee APR, any farming reward APR, gas costs for entering and exiting the pool, and your intended hold period. The calculator shows: your position value if you had just held the tokens, your position value in the LP, the impermanent loss in dollars and percentage, fee income earned, farming rewards earned, and your net result versus holding.
For Uniswap V3-style concentrated liquidity, enter your price range bounds. Concentrated positions earn proportionally more fees within range but suffer amplified impermanent loss and earn zero fees when price moves outside your range.
Pair this with the Crypto Capital Gains Tax Calculator to understand the tax implications of your DeFi gains and losses.
Key Terms Explained
- Impermanent Loss (IL)
- The difference in value between holding tokens in a liquidity pool versus simply holding them in a wallet. Called 'impermanent' because it reverses if prices return to their original ratio — but becomes permanent when you withdraw.
- Automated Market Maker (AMM)
- A smart contract that enables decentralized token swaps using liquidity pools instead of order books. Examples include Uniswap, SushiSwap, and Curve.
- Liquidity Pool
- A smart contract holding pairs of tokens that traders swap against. Liquidity providers deposit tokens and earn a share of trading fees proportional to their share of the pool.
- Concentrated Liquidity
- A Uniswap V3 feature where LPs choose a specific price range. Capital is more efficient within range (earning more fees) but earns nothing outside range and suffers amplified IL.
- APY vs APR
- APR is the simple annual rate without compounding. APY includes compounding effects. A 50% APR compounds to 64.9% APY if compounded daily. DeFi protocols display both inconsistently.
- Yield Farming
- Earning additional token rewards (beyond trading fees) for providing liquidity, typically paid in the protocol's governance token. These rewards may lose value over time.
Who Needs This Tool
Attracted by high APYs on a stablecoin-ETH pool but wants to understand the real risk before depositing significant funds.
Runs multiple concentrated liquidity positions and needs to track real performance across different pools and price ranges.
Comparing multiple farming opportunities and needs to factor in gas costs, IL risk, and reward token volatility to find the best risk-adjusted yield.
Needs to calculate actual gains and losses from LP positions for tax reporting, separating trading fee income from impermanent loss.
Methodology & Formulas
Impermanent Loss = 2 × sqrt(P1/P0) / (1 + P1/P0) − 1, where P0 is the initial price ratio and P1 is the final ratio. LP Value = Initial Value × (1 + IL). Fee Income = (Initial Value × Fee APR × Days / 365). Farming Income = (Initial Value × Farm APR × Days / 365). Real Return = LP Value + Fee Income + Farming Income − Gas Costs − Initial Value. Concentrated Liquidity multiplier = 1 / (1 − sqrt(Pa/Pb)), where Pa and Pb are range bounds.
Pro Tips
- Stablecoin-stablecoin pools (USDC-USDT) have near-zero impermanent loss — they are the safest yield farming option if you just want to earn fees on stable assets.
- Never look at APY alone — a pool showing 200% APY with a volatile token pair can easily lose you 30%+ from impermanent loss if one token drops significantly.
- For concentrated liquidity, narrower ranges earn dramatically more fees but require active management — set price alerts and rebalance when price approaches your range boundary.
- Gas costs matter enormously for small positions — entering and exiting a pool on Ethereum mainnet can cost $50-200+, wiping out months of yield on small deposits.
- Farming reward tokens often decline in value over time due to inflation — model your returns assuming the reward token loses 50%+ of its value during your hold period.