LP Impermanent Loss Calculator
Pricing
$1.00 / 1,000 calculations
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.
What does LP Impermanent Loss Calculator do?
The LP Impermanent Loss Calculator computes impermanent loss (IL) and full position economics for any constant-product AMM liquidity pool — including Uniswap v2, Uniswap v3, SushiSwap, PancakeSwap, and every x*y=k DEX. Provide two token IDs and it fetches live prices from CoinGecko automatically, or enter your own price ratio for manual analysis. It outputs not just the raw IL percentage but a full suite of LP risk metrics: breakeven fee APY, position health score, HODL alpha, rebalancing signal, and concentrated liquidity range utilization for v3 positions.
Why use LP Impermanent Loss Calculator?
- Accurate v2 and v3 math: Uses the exact constant-product formula
IL = 2√k/(1+k) - 1for full-range pools and out-of-range boundary logic for concentrated Uniswap v3 positions — not rough approximations. - Live price integration: Fetches real-time token prices from CoinGecko and real pool APY data from DeFiLlama so your IL analysis reflects current market conditions, not stale inputs.
- Scenario sweep across 14 price points: One run generates the full IL curve from -95% to +10x price change, letting you stress-test a position before committing capital.
- Actionable signals, not just numbers: The Position Health Score (0–100 composite), Rebalancing Signal (hold/rebalance/exit), and Optimal Hold Period translate raw IL math into decisions you can act on immediately.
- Fee offset modeling: Enter your pool's fee APY and holding days to see whether fee income covers the IL — the key question every LP provider needs answered before entering or exiting a position.
How to use LP Impermanent Loss Calculator
- Go to the Apify Store and search for "LP Impermanent Loss Calculator," then click Try for free.
- In the Input tab, enter the CoinGecko IDs for your two tokens (e.g.,
ethereumandtether) — or leave them blank and enter your own price ratios manually. - Set
initialValueUsdto your LP deposit size (default $10,000) andholdingDaysto how long you have held or plan to hold the position. - Optionally enter the pool's
feeApyPctfrom DeFiLlama or your AMM dashboard to model fee income against IL. - Enable
scenarioModeto generate the full IL curve across 14 price scenarios, or leave it off for a single-point calculation. - For Uniswap v3 concentrated positions, fill in
v3LowerRatioandv3UpperRatio(e.g., 0.8 and 1.25 for a ±25% range). - Click Start and view results in the Dataset tab. Export as JSON, CSV, or Excel.
Input
| Field | Type | Default | Description |
|---|---|---|---|
tokenACoingeckoId | string | — | CoinGecko ID for token A (e.g. ethereum). Leave blank for manual mode. |
tokenBCoingeckoId | string | — | CoinGecko ID for token B (e.g. tether). Usually a stablecoin for USD pools. |
initialPriceRatio | number | — | Price of token A / token B at pool entry. Required for non-current entry prices. |
currentPriceRatio | number | — | Current A/B price ratio (manual mode only, when CoinGecko IDs are not set). |
initialValueUsd | number | 10000 | Total USD deposited into the LP at entry. |
feeApyPct | number | 0 | Pool fee APY in percent (e.g. 10 = 10% APY). Used to calculate fee income offsetting IL. |
holdingDays | integer | 365 | Days held or planned holding period. Used to prorate fee income and annualize IL. |
scenarioMode | boolean | false | If true, runs IL calculation across 14 price scenarios (0.1x – 10x). |
v3LowerRatio | number | — | Uniswap v3 lower price bound as a ratio vs entry (e.g. 0.8 = −20%). Leave blank for full-range v2. |
v3UpperRatio | number | — | Uniswap v3 upper price bound as a ratio vs entry (e.g. 1.5 = +50%). Leave blank for full-range v2. |
Output
[{"mode": "auto","token_a": "ethereum","token_b": "tether","initial_price_ratio": 2400.0,"current_price_ratio": 3200.0,"price_change_pct": 33.33,"il_pct": -1.48,"il_usd": -148.12,"lp_value_usd": 10703.88,"hodl_value_usd": 10851.65,"net_pnl_vs_hodl_usd": -148.12,"fee_income_usd": 82.19,"net_lp_return_usd": -65.93,"breakeven_fee_apy_pct": 1.48,"position_health_score": 74,"rebalancing_signal": "hold","hodl_alpha_annualized_pct": -0.52,"il_risk_category": "low","optimal_hold_period": "long_term","lp_vs_hold_comparison": "lp_clearly_better","fetched_at": "2026-09-02T10:00:00Z"},{"mode": "scenario","scenario_label": "2x price increase","price_change_pct": 100.0,"il_pct": -5.72,"il_usd": -572.43,"lp_value_usd": 14142.14,"hodl_value_usd": 15000.0,"net_pnl_vs_hodl_usd": -572.43,"breakeven_fee_apy_pct": 5.72,"position_health_score": 51,"rebalancing_signal": "rebalance","il_risk_category": "moderate","fetched_at": "2026-09-02T10:00:00Z"}]
Data fields
| Field | Description |
|---|---|
mode | Calculation mode: auto, manual, or scenario |
token_a / token_b | Token identifiers used in this calculation |
initial_price_ratio | A/B price ratio at the time of LP entry |
current_price_ratio | A/B price ratio at the time of calculation |
price_change_pct | Percentage price change from entry to current |
il_pct | Impermanent loss as a percentage of initial deposit |
il_usd | Impermanent loss in USD |
lp_value_usd | Current value of the LP position in USD |
hodl_value_usd | Value if tokens had been held instead of providing liquidity |
net_pnl_vs_hodl_usd | LP value minus HODL value (negative = IL drag) |
fee_income_usd | Estimated fee income accumulated over holdingDays at feeApyPct |
net_lp_return_usd | LP P&L after subtracting IL and adding fee income |
breakeven_fee_apy_pct | Minimum fee APY required to fully offset IL at current price change |
position_health_score | Composite 0–100 score (higher = better LP economics) |
rebalancing_signal | Action recommendation: hold, rebalance, or exit |
hodl_alpha_annualized_pct | LP return vs HODL, annualized |
il_risk_category | Risk tier: minimal, low, moderate, high, extreme |
optimal_hold_period | short_term, medium_term, long_term, or never_profitable |
lp_vs_hold_comparison | Verdict: lp_clearly_better through lp_significantly_worse |
concentration_risk | Uniswap v3 concentration risk (v3 positions only) |
price_range_utilization_pct | Estimated % of time price is within the v3 range |
fetched_at | ISO 8601 UTC timestamp of the calculation |
Cost estimation
The actor charges $0.001 per calculation (Pay-Per-Event). A single-point calculation is one event; scenario mode generates 14 events.
| Scenario | Calculations | Estimated cost |
|---|---|---|
| Single IL check (manual or auto) | 1 | $0.001 |
| Scenario sweep (14 price points) | 14 | $0.014 |
| 100 scenario sweeps for backtesting | 1,400 | $1.40 |
FAQ
Q: What is the difference between v2 and v3 mode?
A: V2 (full-range) uses the standard constant-product formula that applies to Uniswap v2, SushiSwap, PancakeSwap, and most AMMs. V3 (concentrated liquidity) models positions with custom price ranges — capital is more efficient inside the range but IL becomes total loss outside it. Fill in v3LowerRatio and v3UpperRatio to activate v3 mode.
Q: Where does the fee APY data come from? A: You can enter the fee APY manually from your AMM dashboard, or the actor can optionally pull it from DeFiLlama's yield API if you provide a DeFiLlama pool ID. The pool APY is used only to estimate fee income; it does not affect the IL calculation itself.
Q: Why does my LP value differ from what the AMM UI shows? A: The actor computes theoretical LP value based on price ratios and the AMM formula. Small discrepancies may arise from rounding, price feed latency, or pool-specific factors like protocol fees or liquidity depth. Use this actor for planning and comparative analysis rather than precise accounting.
Disclaimer: This actor is for educational and research purposes only. Impermanent loss calculations are mathematical estimates based on AMM formulas and public price data. They are not financial advice. Always verify numbers against your AMM's own UI before making liquidity management decisions. Cryptocurrency investments carry significant risk of loss.
Keywords: impermanent loss calculator, LP impermanent loss, Uniswap v2 impermanent loss, Uniswap v3 concentrated liquidity, AMM liquidity pool risk, DeFi LP calculator, liquidity provider breakeven, IL percentage calculator, CoinGecko price ratio, DeFi yield vs HODL
Related actors
- Curve Pool Scanner — Curve liquidity pool APYs to compare against LP impermanent loss breakeven fee rates
- DeFi Yield APY Scanner — Cross-protocol yield comparison to evaluate whether LP APY justifies impermanent loss risk
- DEX Volume Tracker — Trading volume by pool to estimate fee income for impermanent loss breakeven analysis
Feedback
If this actor powers your LP research, a review helps others find it: Leave a review on Apify Store
Keywords: impermanent loss calculator, Uniswap v2 LP math, AMM impermanent loss, LP vs HODL comparison, DeFi yield breakeven, CoinGecko price feed, liquidity provider P&L, fee income calculator, price ratio scenario sweep, Uniswap v3 impermanent loss, DeFi risk calculator, AMM LP returns, stablecoin pool IL, concentrated liquidity IL