LP Impermanent Loss Calculator avatar

LP Impermanent Loss Calculator

Pricing

Pay per usage

Go to Apify Store
LP Impermanent Loss Calculator

LP Impermanent Loss Calculator

Calculate impermanent loss for Uniswap v2-style AMM pools. Auto-fetch current prices via CoinGecko or provide manual ratios. Compares LP vs HODL P&L, factors in fee income, generates scenario sweep. $0.001/calculation.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Hojun Lee

Hojun Lee

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 days ago

Last modified

Share

Calculate exact impermanent loss (IL) for constant-product AMM liquidity positions — Uniswap, SushiSwap, PancakeSwap, and any x*y=k AMM.


What It Does

Computes impermanent loss and LP position value based on price change from entry to current, using the constant-product AMM formula.

  • Auto mode: Fetch live prices from CoinGecko for any two tokens
  • Manual mode: Enter a custom price ratio directly
  • Scenario sweep: Generate IL across 14 price change scenarios (-95% to +10x)

Outputs LP value, HODL value, net P&L, and the minimum fee APY needed to break even.


Input

FieldTypeDefaultDescription
modestringscenario_sweepauto (CoinGecko), manual (custom ratio), scenario_sweep
coinAIdstringethereumCoinGecko ID for token A (auto mode)
coinBIdstringbitcoinCoinGecko ID for token B (auto mode)
initialPriceRationumberB/A price ratio at entry (manual mode)
currentPriceRationumberB/A price ratio now (manual mode)
initialLiquidityUsdnumber10000Initial USD deposited into the LP
holdingPeriodDaysnumber30Days held (for annualized breakeven fee calculation)

Output

FieldDescription
price_ratioCurrent price ratio vs entry
il_pctImpermanent loss percentage
lp_value_usdCurrent LP position value
hodl_value_usdWhat HODL would be worth
net_pnl_vs_hodlLP vs HODL dollar difference
breakeven_fee_apy_pctRequired fee APY to offset IL

Pricing

$0.001 per calculation (flat per run).

Use Cases

  • Evaluate whether a pool's fee APY justifies the IL risk
  • Compare LP entry prices vs current for risk/reward decisions
  • Stress-test portfolio against extreme price moves