Home › Templates › Impermanent loss spreadsheet
Impermanent Loss Spreadsheet
A free impermanent loss calculator for Excel and Google Sheets. Type the token prices at entry and now, and it shows the loss against simply holding, your LP value and HODL value in dollars, the fee APR you need to break even, and the price band where fees still cover the loss. It also handles Uniswap v3 concentrated ranges and logs up to 30 LP positions.
Use it in Google Sheets: choose File → Import → Upload in Sheets and pick the .xlsx, or upload it to Google Drive and open it with Google Sheets. No sign-up, no email gate.
| Position | Type | Range | Deposit | Ratio r | HODL | LP | IL | Fees | Costs | Net vs HODL | Price vs range |
|---|---|---|---|---|---|---|---|---|---|---|---|
| ALFA/USDX wide | v2 | full | $5,000 | 1.300 | $5,750.00 | $5,700.88 | −0.85% | $310 | $18 | $242.88 | Full range |
| ALFA/USDX 2,100-2,900 | v3 | 2,100–2,900 | $4,000 | 1.083 | $4,194.32 | $4,151.26 | −1.03% | $260 | $25 | $191.94 | In range |
| ALFA/USDX 1,700-2,300 | v3 | 1,700–2,300 | $3,000 | 1.368 | $3,693.50 | $3,188.69 | −13.67% | $120 | $22 | −$406.81 | Above range: all token B |
| BRAVO/ALFA | v2 | full | $2,500 | 0.577 | $2,562.50 | $2,468.55 | −3.67% | $95 | $12 | −$10.95 | Full range |
| USDX/USDY 0.995-1.005 | v3 | 0.995–1.005 | $6,000 | 1.002 | $5,999.99 | $5,998.78 | −0.02% | $70 | $8 | $60.80 | In range |
| Total (5 positions) | $20,500 | $22,200.30 | $21,508.15 | −3.12% | $855 | $85 | $77.85 | 1 out of range | |||
What impermanent loss is
A constant-product pool keeps the product of its two token reserves fixed between fees: x × y = k (Uniswap v2 Core whitepaper). When the market price of one token moves, arbitrage traders buy the cheap side from the pool until its price matches. Your share ends up with less of the token that rose and more of the one that fell.
Compare that with keeping the same tokens in a wallet ("HODL"). The pool position is worth less whenever the price ratio has moved, in either direction. The Uniswap v2 docs show it with 1 ETH and 100 DAI deposited at 100 DAI per ETH. After ETH moves to 120 DAI, the share is 0.9129 ETH and 109.54 DAI, worth 219.09 DAI. Holding would be worth 220 DAI. The gap of 0.91 DAI is the impermanent loss (Uniswap docs: Understanding Returns). The template's IL calculator opens with exactly this case and returns $219.09 vs $220.00.
“Of course, if the price were to return to the same value as when the liquidity provider added their liquidity, this loss would disappear. For this reason, we can call it an impermanent loss.”Uniswap v2 docs, Understanding Returns (quoting Pintail's analysis)
Impermanent loss formula and price-ratio table
With r the price ratio (token A priced in token B now, divided by the same at entry), the docs give:
impermanent loss = 2·√r / (1 + r) − 1
The loss depends only on r, not on the deposit size or the direction of the move. r = 2 (token A doubles against B) and r = 0.5 (it halves) give the same −5.7%. The template's price-ratio table, for a $200 deposit with token B unchanged, next to the figures in the Uniswap docs:
| Price ratio r | Token A vs B | Impermanent loss | HODL ($200) | LP ($200) | Uniswap docs |
|---|---|---|---|---|---|
| 0.1 | −90% | −42.50% | $110.00 | $63.25 | – |
| 0.2 | −80% | −25.46% | $120.00 | $89.44 | – |
| 0.25 | −75% | −20.00% | $125.00 | $100.00 | – |
| 0.33 | −67% | −13.40% | $133.33 | $115.47 | – |
| 0.5 | −50% | −5.72% | $150.00 | $141.42 | – |
| 0.67 | −33% | −2.02% | $166.67 | $163.30 | – |
| 0.75 | −25% | −1.03% | $175.00 | $173.21 | – |
| 0.8 | −20% | −0.62% | $180.00 | $178.89 | – |
| 0.9 | −10% | −0.14% | $190.00 | $189.74 | – |
| 1 | 0% | 0.00% | $200.00 | $200.00 | – |
| 1.1 | +10% | −0.11% | $210.00 | $209.76 | – |
| 1.25 | +25% | −0.62% | $225.00 | $223.61 | 0.6% |
| 1.5 | +50% | −2.02% | $250.00 | $244.95 | 2.0% |
| 1.75 | +75% | −3.79% | $275.00 | $264.58 | 3.8% |
| 2 | +100% | −5.72% | $300.00 | $282.84 | 5.7% |
| 3 | +200% | −13.40% | $400.00 | $346.41 | 13.4% |
| 4 | +300% | −20.00% | $500.00 | $400.00 | 20.0% |
| 5 | +400% | −25.46% | $600.00 | $447.21 | 25.5% |
| 10 | +900% | −42.50% | $1,100.00 | $632.46 | – |
Two things the table shows. Small moves cost little: a 10% move costs 0.11%. Big moves cost a lot: at 5× the pool is 25.5% behind holding. The LP value still rose in dollars at r = 5 ($447.21 from $200); impermanent loss compares two positions, it is not a dollar loss on its own.
What's inside the spreadsheet
| Tab | What you type | What it calculates |
|---|---|---|
| Start here | Nothing | Steps, every formula in plain words, colour key, limits, sources, disclaimer |
| Summary | Nothing | Your log's totals (HODL, LP, impermanent loss, fees, costs, net vs HODL, positions out of range, worst loss) next to the Example's |
| IL calculator | Deposit value, token A and B prices at entry and now, fee APR, days | Price ratio, impermanent loss, HODL and LP value, token amounts before and after, fees, LP + fees − HODL, break-even fee APR, break-even price ratios and prices; a 19-row price-ratio table (0.1× to 10×) with a chart |
| Range (v3) | Deposit, entry price, range min and max, price now, fee APR in range, days, share of days in range | Liquidity L, capital efficiency vs full range, token amounts at entry and now, LP vs HODL, loss for this range and for full range, fees, break-even APR, value at the range edges; a 21-row price table with a chart |
| Position log | Up to 30 positions: name, pair, pool type, dates, deposit, 4 prices, range, fees, costs | Per row: price ratio, token amounts, HODL, LP, loss in $ and %, net vs HODL, fee APR earned, in or out of range, fees needed to match HODL. Totals and a bar chart |
| Example | Already filled: 5 fictional positions | The Position log with every result visible |
How to use it
- Quick check: open IL calculator. Type the deposit value and the token prices at entry and now in dollars. For a stablecoin pair, token B is 1 and 1. Add the fee APR you expect and the days.
- Read the loss, the LP and HODL values, and LP + fees − HODL. The break-even rows show the fee APR you would need, and the token A prices between which your APR still keeps you ahead.
- v3 range: open Range (v3). Type the entry price, the range min and max and the price now, all as token A priced in token B (the way the pool page shows them, for example USDC per ETH).
- Your positions: open Position log. One position per row from row 7. Pick Full range (v2) or Range (v3). Type the fees your pool page shows (collected plus uncollected) and any gas costs.
- Check the Status cell (C1) says OK. A row with a problem shows the reason in column Q, for example “Range: min above 0, max above min”. Then read the Summary tab.
LP value vs HODL value with two volatile tokens
Most calculators assume one side is a stablecoin. The template does not. With gA and gB each token's price now divided by its price at entry, and a 50/50 deposit:
HODL = deposit × (gA + gB) / 2 LP = deposit × √(gA × gB) LP / HODL − 1 = 2√r/(1+r) − 1, r = gA/gB
The calculator shows both lines and a check row that must equal the loss. In the Example, the fictional BRAVO/ALFA pool has BRAVO falling from $40 to $30 while ALFA rises from $2,000 to $2,600: r = 0.577, HODL $2,562.50, LP $2,468.55, a loss of −3.67%.
Exact formulas from the IL calculator tab (C5 = deposit, C6/C7 = token A price at entry/now, C8/C9 = token B, C10 = APR, C11 = days, C15 = gA, C16 = gB). In the file each is wrapped in IF($C$12="OK", …, "") so it stays blank until the inputs are valid.
| Field | Formula |
|---|---|
| Price ratio r (C17) | =$C$15/$C$16 |
| Impermanent loss (C18) | =2*SQRT($C$17)/(1+$C$17)-1 |
| HODL value (C19) | =$C$5*($C$15+$C$16)/2 |
| LP value (C20) | =$C$5*SQRT($C$15*$C$16) |
| Fees, estimate (C27) | =$C$5*N($C$10)*N($C$11)/365 |
| Break-even fee APR (C30) | =IF(N($C$11)>0,MAX($C$19-$C$20,0)/$C$5*365/$C$11,"Enter days") |
| Break-even ratio, lower (C32) | =IF(2*$C$31>=1,0,(1-SQRT(2*$C$31))^2) |
| Break-even ratio, upper (C33) | =(1+SQRT(2*$C$31))^2 |
Fees vs impermanent loss: the break-even
Fees are what LPs are paid for taking this risk. The Uniswap v2 docs: “0.3% of all trade volume is distributed proportionally to all liquidity providers.” That changed in December 2025. The Uniswap fees page now says: “With the passage of the UNIfication governance proposal in December 2025, protocol fees are now active on all v2 pools and select v3 pools.” Its table lists the v2 split as 0.25% to LPs and 0.05% to the protocol; the v2 whitepaper had designed that switch as “16.6% of that fee (0.05% of the amount traded)” (Uniswap docs: Fees, v2 whitepaper, section 2.4). So type the fees your pool page reports rather than working them out from volume.
The template treats fees as a simple amount: deposit × APR × days / 365. LP + fees beats HODL when the fees are bigger than the gap. Written as a share of the deposit, with token B stable and f = APR × days / 365:
√r + f = (1 + r) / 2 ⇒ break-even r = (1 − √(2f))² and (1 + √(2f))²
In the pre-filled calculator (12% APR for 30 days, f = 0.986%), fees of $1.97 cover the $0.91 loss. They keep covering it while token A stays between $73.88 and $130.06 (r from 0.7388 to 1.3006). To break even at the actual move to $120, an APR of 5.54% would have been enough. The price-ratio table repeats the LP + fees − HODL line for every ratio.
Uniswap v3 concentrated ranges
In Uniswap v3 an LP picks a price range. Inside it, the position behaves like a bigger constant-product pool. Outside it, the Uniswap docs say, “the position's liquidity is no longer active and no longer earns fees”, and “LPs gain more of one asset as swappers demand the other, until their entire position consists of a single asset” (Uniswap docs: Concentrated Liquidity).
The Range (v3) tab uses the token amounts from section 6.4 of the Uniswap v3 Core whitepaper (formulas 6.29 and 6.30). With prices as token A in token B, a range from pa to pb and s = √price kept inside [√pa, √pb]:
token A = L·(1/s − 1/√pb) token B = L·(s − √pa)
L is the position's liquidity. The sheet sets it so the entry value equals your deposit. HODL is the entry amounts at today's price; LP is today's amounts. With pa = 0 and pb = ∞ the same formula gives the v2 result, so the Position log uses it for both pool types. Exact formulas from the tab (C5 = deposit, C6 = entry price, C9 = price now, C17 = √pa, C18 = √pb, C19 = √entry price clamped to the range, C26 = √price now clamped to the range):
| Field | Formula |
|---|---|
| Liquidity L (C20) | =$C$5/((1/$C$19-1/$C$18)*$C$6+($C$19-$C$17)) |
| Token A deposited (C23) | =$C$20*(1/$C$19-1/$C$18) |
| Token B deposited (C24) | =$C$20*($C$19-$C$17) |
| SQRT(price) now, clamped (C26) | =MIN(MAX(SQRT($C$9),$C$17),$C$18) |
| LP value now (C30) | =$C$27*$C$9+$C$28 |
| HODL value now (C31) | =$C$23*$C$9+$C$24 |
The pre-filled case is fictional: $10,000 into an ALFA/USDX range of 1,600–2,500 at 2,000. That range holds 9.47× the liquidity of a full-range deposit. ALFA moving to 2,300 leaves 0.9017 ALFA and 8,427.99 USDX worth $10,501.88, against $10,750.00 for holding: a −2.31% loss, versus −0.24% for the same move at full range. At a 25% fee APR for 30 days, fees of $205.48 do not cover it; the break-even APR in range is 30.2%.
| Move | ALFA price | Range value | HODL | IL, range | IL, full range | Price vs range |
|---|---|---|---|---|---|---|
| −50% | $1,000 | $5,295.08 | $7,500.00 | −29.40% | −5.72% | Below |
| −40% | $1,200 | $6,354.10 | $8,000.00 | −20.57% | −3.18% | Below |
| −30% | $1,400 | $7,413.12 | $8,500.00 | −12.79% | −1.57% | Below |
| −20% | $1,600 | $8,472.14 | $9,000.00 | −5.87% | −0.62% | In range |
| −10% | $1,800 | $9,375.28 | $9,500.00 | −1.31% | −0.14% | In range |
| 0% | $2,000 | $10,000.00 | $10,000.00 | 0.00% | 0.00% | In range |
| +10% | $2,200 | $10,387.17 | $10,500.00 | −1.07% | −0.11% | In range |
| +20% | $2,400 | $10,568.56 | $11,000.00 | −3.92% | −0.41% | In range |
| +30% | $2,600 | $10,590.17 | $11,500.00 | −7.91% | −0.85% | Above |
| +40% | $2,800 | $10,590.17 | $12,000.00 | −11.75% | −1.40% | Above |
| +50% | $3,000 | $10,590.17 | $12,500.00 | −15.28% | −2.02% | Above |
Above the range the position is all USDX and its value stops changing ($10,590.17 at 2,500); below it, it is all ALFA ($8,472.14 at 1,600). The loss against holding keeps growing outside the range, as it does in the table.
How the v3 math was checked. Python compared formulas 6.29 and 6.30 against the official Uniswap v3 SDK (Position.amount0 and amount1, integer math) on 300 random tick ranges with the price in, below and above the range: largest relative difference 2.5 × 10−14. It also checked that the amounts sit on the whitepaper's real-reserves curve (x + L/√pb)(y + L·√pa) = L² (formula 2.2), that a very wide range gives the v2 loss, and a step-by-step swap simulation. Details are in the template's notes.
The Uniswap app snaps ranges to ticks: prices of the form 1.0001i (whitepaper formula 6.1), on a spacing set by the fee tier. Your actual min and max can differ slightly from round numbers, so copy them from the position page.
Position log: every LP position in one table
The log takes any mix of full-range and range positions on any two tokens. For each row it works out the price ratio, the token amounts then and now, HODL and LP value, the loss in dollars and percent, net vs HODL after fees and costs, the fee APR you actually earned, whether a v3 position is in range, and the fees still needed to match holding. Exact formulas from row 8 of the Example tab (G = deposit, I = token B price at entry, J/K = prices now, S = entry price in B, V = √min, W = 1/√max, X/Y = clamped √prices):
| Field | Formula |
|---|---|
| SQRT(P0) in range (X8) | =IF(D8="Range (v3)",MIN(MAX(SQRT(S8),V8),SQRT(M8)),SQRT(S8)) |
| Liquidity L (Z8) | =(G8/I8)/((1/X8-W8)*S8+(X8-V8)) |
| HODL value (AE8) | =AA8*J8+AB8*K8 |
| LP value (AF8) | =AC8*J8+AD8*K8 |
| Net vs HODL (AJ8) | =AI8-AE8 |
Worked example from the sample data
The Example tab holds five fictional positions valued on 2 Nov 2026 (see the preview table above):
- Full range, ALFA up 30% ($2,000 to $2,600): loss −0.85% (−$49.12). Fees of $310 over 182 days, a 12.4% APR, more than cover it: net $242.88.
- v3 range still in range (2,100–2,900, ALFA from 2,400 to 2,600): only an 8% move, but the narrow range turns it into a −1.03% loss, more than the −0.85% of the full-range row after a 30% move. Fees still put it $191.94 ahead.
- v3 range left behind (1,700–2,300, ALFA now 2,600): the position is all USDX. The loss is −13.67% (−$504.81) and fees stopped once the price left the range. Net −$406.81; it would need $526.81 more in fees to match holding.
- Two volatile tokens (BRAVO/ALFA): BRAVO fell while ALFA rose, r = 0.577. Loss −3.67%; fees nearly cover it, net −$10.95.
- Two stablecoins in a tight range (0.995–1.005): the ratio moved 0.2%, the loss is −0.020%, and the $70 of fees decide the result: net $60.80.
- Total: HODL $22,200.30, LP $21,508.15, loss −$692.15. Fees $855 minus costs $85 leave the five positions $77.85 ahead of holding (0.35%). One position is out of range; the worst single loss is −13.67%.
Common mistakes
- Comparing with your deposit instead of with holding. If both tokens rose, the LP value can be far above what you put in and still behind HODL. Impermanent loss is measured against holding.
- Using one token's price change as r. r is the change in token A priced in token B. If both tokens moved, divide one change by the other.
- Typing the range upside down. Range prices must be token A priced in token B, the same direction as the entry and current price. If the pool page shows the inverse, flip all three (1/price) and swap min and max.
- Counting only collected fees. Uncollected fees are part of the position. Use the total your pool page shows.
- Forgetting gas. Opening, adjusting and closing positions cost gas. On small positions this can outweigh the fees.
- Logging a position you added to. The log assumes one deposit at the entry price. If you added or removed liquidity later, log each change as its own row.
Limits
- Two-token, 50/50 constant-product curves only: Uniswap v2, v2-style forks and v3 ranges. Not weighted pools (for example 80/20), stable-swap curves or pools with dynamic fees or hooks.
- Fees are your input. Real fee income moves with volume and liquidity, and v2 fees are added to the pool and compound; the sheet adds them as a simple amount.
- The v3 sheet ignores tick rounding and token decimals: type human prices as the app shows them.
- Range (v3) values assume token B is worth $1. Use the Position log for ranges between two volatile tokens.
- Not modelled: liquidity-mining rewards, taxes, smart contract risk, stablecoin depegs, MEV.
- Recalculation was tested in LibreOffice. The file uses only functions that exist in Excel 2016+ and Google Sheets.
FAQ
How do you calculate impermanent loss in Excel?
Put the price ratio r in a cell: (token A price ÷ token B price now) ÷ (the same at entry). Then =2*SQRT(r)/(1+r)-1 gives the loss against holding, the formula in the Uniswap v2 docs. For dollar amounts, HODL value = deposit × (gA + gB) ÷ 2 and LP value = deposit × SQRT(gA × gB), where gA and gB are each token's price now ÷ at entry. The template has these ready with a price-ratio table and a chart.
How much impermanent loss is there if the price doubles?
About 5.7% against holding the same tokens, before fees, in a full-range constant-product pool. A halving gives the same 5.7%: the formula is symmetric in r and 1/r. A 5× move costs about 25.5%. Those match the Uniswap v2 docs (5.7% and 25.5%).
Do trading fees cover impermanent loss?
Sometimes. Fees are added to the LP side, the loss is taken off it. The sheet works out the fee APR you would need to break even, and the price band inside which a given APR keeps you ahead: with f = APR × days ÷ 365, the band runs from r = (1 − √(2f))² to (1 + √(2f))². Outside that band the loss is bigger than the fees.
Is impermanent loss bigger on Uniswap v3?
Inside the range, yes, for the same deposit. A concentrated position holds more liquidity per dollar, so it earns more fees while in range and loses more on a price move. In the template's fictional example a 1,600–2,500 range has 9.5× the liquidity of a full-range deposit, and a move from 2,000 to 2,300 costs 2.31% against 0.24% for full range.
Does this impermanent loss spreadsheet work in Google Sheets?
Yes. Import the .xlsx (File → Import → Upload) or open it from Google Drive. Functions used: IF, AND, OR, NOT, ISNUMBER, N, SQRT, MIN, MAX, SUM, SUMIF, SUMPRODUCT, COUNTIF, LEFT. No macros, add-ins or price feeds: you type the prices.
When does impermanent loss become permanent?
When you withdraw. While the tokens stay in the pool the loss changes with the price ratio and disappears if the ratio returns to where it was at entry. The Uniswap v2 docs call it impermanent for that reason. Once you remove liquidity, the token mix you get back is fixed.
Related templates and tools
- Crypto portfolio trackerHoldings, cost basis and allocation
- Crypto staking rewards trackerLog rewards and their value
- Crypto tax spreadsheetGains and losses per disposal
- Crypto profit calculatorProfit on a single trade
- All templatesFree spreadsheets
Educational template only, not investment advice. Example data is fictional: ALFA, BRAVO, USDX, USDY, their prices, ranges, fees and costs are made up to show the formulas and say nothing about any real token, pool or future result. Providing liquidity can lose money, including through smart contract failures and stablecoin depegs that this sheet does not model. Sources: H. Adams, N. Zinsmeister, D. Robinson, Uniswap v2 Core, March 2020; H. Adams, N. Zinsmeister, M. Salem, R. Keefer, D. Robinson, Uniswap v3 Core, March 2021; Uniswap developer docs: Understanding Returns, Concentrated Liquidity, Fees. Retrieved 9 November 2026.