Uniswap impermanent loss is diagnosed by comparing price-ratio divergence with earned fees
Uniswap impermanent loss measures how a liquidity position falls behind the same starting token quantities held outside the pool after their relative price changes. Diagnose it by fixing one valuation time, reconstructing that hold benchmark, valuing the position's current token mix, and accounting for fees separately. Market losses, display delays, and network costs are different effects.
Start with the position's protocol version, range status, deposited quantities, current token quantities, and fee records. Those facts determine whether a full-range formula applies or a concentrated-liquidity calculation is required.
A valid diagnosis compares identical starting token quantities at one timestamp, then accounts for fees without counting them twice.
Position Signals With Different Meanings
Each visible signal answers a different diagnostic question, so no single balance or status proves impermanent loss.
A position worth less than its initial fiat value may simply reflect a decline in both tokens. A changing token mix shows that swaps have altered the pool reserves as the relative price moved. An out-of-range label means that a concentrated position is inactive at the pool's current price. Unclaimed fees show compensation earned from eligible swaps, but they do not reveal whether that compensation has exceeded the hold benchmark shortfall.
The relevant comparison is the position against holding the same starting quantities, not against the original deposit value alone.
Keep the observations separate until every component uses the same valuation time and token identities.
Evidence Required Before Calculation
A defensible calculation needs the position's actual records rather than a remembered deposit value. Gather the entry quantities before choosing a formula, because protocol version, range bounds, and later liquidity changes alter the correct method. The comparison timestamp also matters. A position valued now cannot be compared with token prices captured earlier.
- Token quantities contributed during each liquidity addition
- Pool identity, protocol version, applicable fee tier, and any Uniswap v4 hook configuration
- Price bounds and current range status for concentrated liquidity
- Current principal quantities, collected fees, and unclaimed fees
- One synchronized price snapshot for the position and hold benchmark
Transaction records can also expose partial withdrawals or added liquidity that a simple entry-versus-current calculation would miss.
The Matching Hold Benchmark
The hold benchmark values the original token quantities at the comparison timestamp. For starting quantities q0 and q1, with synchronized prices p0 and p1, its value is q0 × p0 + q1 × p1. Use the same quote currency and token contracts when valuing the pool position.
Later additions require separate records. Treat each contribution as another set of token quantities that the alternative strategy would have held from that contribution time. Partial withdrawals reduce the liquidity still exposed to the pool, while the tokens received remain part of total performance. This cash-flow-aware benchmark prevents a new deposit from disguising an older shortfall.
Price-Ratio Divergence Versus Market Loss
Impermanent loss concerns relative performance, while market loss concerns the outright value of the assets.
If both tokens decline together while their price ratio remains unchanged, the liquidity position and the hold benchmark can both lose fiat value without creating raw ratio-driven divergence. When one token appreciates relative to the other, automated swaps change the pool's composition. The position accumulates more of the relatively weaker token and less of the stronger token, which can leave it behind the unchanged starting basket.
Subtract the hold benchmark from the comparable position value. Do not classify the entire decline from the original deposit value as impermanent loss.
The Full-Range Constant-Product Formula
For a full-range constant-product position before fees, relative divergence can be written as 2√r / (1 + r) - 1, where r is the current price ratio divided by the entry ratio.
The expression equals zero when the relative price returns to its entry level and becomes negative as the ratio moves away in either direction. It measures performance against holding, not the position's fiat gain or loss. Reciprocal ratio moves produce the same raw divergence when the price convention remains consistent.
This formula does not cover a bounded concentrated-liquidity position. It also excludes fees, network costs, later deposits, partial withdrawals, and any other cash flow. Adding those items inside r produces a result that no longer represents the formula's intended comparison.
Fee Income Without Double Counting
Fees belong in the total-return calculation, but their accounting depends on the position structure. In Uniswap v2, fees remain in pool reserves and increase the value represented by the liquidity tokens. A current redeemable-value calculation already reflects that effect, so adding a separate fee estimate would count it twice.
Uniswap v3 positions track earned fees separately from active liquidity until collection. In Uniswap v4, LP fees are also claimable separately, but liquidity operations and optional hooks can alter how accrued amounts are settled. Add collected and unclaimed fees to the comparison only when the principal value excludes them. Value each fee token at the same timestamp used for the principal and hold basket.
Trading volume multiplied by a pool fee rate is not the position's fee income. Earnings also depend on the position's share of active liquidity and, for concentrated liquidity, whether the market price traded inside its range. Use position-level amounts when available. Deduct execution costs separately because they affect net performance without changing raw impermanent loss.
Range Boundaries in Concentrated Liquidity
Concentrated positions require their lower bound, upper bound, current pool price, and token composition. A full-range percentage cannot diagnose them accurately.
Within the selected range, swaps progressively exchange one token for the other. If the pool price crosses a boundary, the position becomes single-sided and stops earning liquidity-provider fees until the price reenters its range. A narrow range concentrates capital near selected prices, which can increase fee exposure there while also making the token composition more sensitive to ratio movement.
Price displays may quote either token as the numerator. Inverting the displayed pair takes the reciprocal of each bound and reverses their order without changing the economic range. Normalize the quote direction before deciding that a position crossed a boundary. Range status identifies whether liquidity is active; it does not by itself calculate relative performance.
A Hypothetical Shortfall Reconciliation
A reader sees a full-range position lagging the expected hold value. In this hypothetical constant-product case, every changing input is illustrative: the relative price multiplier is 1.67, accrued fees equal 1.17% of the hold benchmark, no liquidity changed after entry, and execution costs are initially treated as zero.
The reader first confirms a full-range structure, matching token contracts, one entry event, and synchronized prices. Substituting r = 1.67 into the constant-product formula gives approximately -3.20%. Adding the illustrative fee value produces fee-adjusted relative performance of approximately -2.03% before execution costs.
The reader can leave the position intact while checking the quantities, fee treatment, and timestamp. This calculation explains the observed gap without changing the token composition or ending future fee exposure.
Withdrawing liquidity ends the removed amount's exposure to later swaps. Wait for confirmation before reconciling the withdrawal, because a pending transaction does not prove that the tokens reached the recipient. After confirmation, compare the received token quantities, collected fees, remaining liquidity, and execution cost with the expected result. If prices change before confirmation, both the hold basket and received assets need a new synchronized valuation rather than a mixture of old and new prices.
Withdrawal Timing and Realized Results
Withdrawal converts the current pool composition into wallet balances and ends the removed liquidity's exposure to later swaps. The word “impermanent” does not promise that a price ratio will return or that waiting will repair a shortfall. It describes divergence that can change while the liquidity remains exposed to the pool.
If the ratio returns to its entry level before withdrawal, raw full-range divergence can fall back to zero. Total performance may still differ because fees, execution costs, partial withdrawals, and later contributions remain in the ledger. Once liquidity has been removed, a later ratio reversal does not automatically recreate the token quantities that the original position would have held.
Display Errors and Accounting Gaps
A portfolio display can disagree with a manual calculation without either figure representing impermanent loss correctly. Common causes include delayed fiat prices, opposite quote directions, omitted unclaimed fees, token-decimal mistakes, and a partial withdrawal that remains in transaction history but not in the active balance.
Pool price and fiat valuation serve different purposes. The pool ratio determines composition, while synchronized fiat prices convert the position and hold basket into a common unit. Onchain quantities establish what the position contains. A price feed only values those quantities, so switching feeds midway can create an artificial mismatch.
Contract addresses and networks also matter because symbols can be reused. A balance from another token contract or network does not belong in the same comparison, even if the wallet shows an identical ticker.
The Final Verification Sequence
Final verification begins by matching the pool, token contracts, protocol version, and every liquidity-changing transaction. Reconstruct the hold basket from contributed quantities, then value that basket and the current position at one timestamp. Apply the full-range formula only when its assumptions fit; otherwise use the concentrated position's actual bounds and token amounts.
Next, reconcile collected and unclaimed fees without adding any amount already embedded in principal value. Keep network costs outside raw divergence, then subtract them when evaluating net performance. The remaining difference should agree with the position's observable quantities and status. A reconciled figure shows whether fees covered the ratio-driven shortfall and what economic exposure a withdrawal would actually end.
Before you start with Uniswap impermanent loss
Which Records Matter After a Uniswap v3 Position NFT Is Transferred?
The NFT transfer changes ownership of the position without resetting its liquidity, range, or accrued fee accounting. A new owner still needs the earlier contribution quantities and transaction history to reconstruct the original hold benchmark. The NFT alone does not encode a complete personal performance baseline for every prior cash flow.
When Does Moving a Concentrated Position Create a New Comparison Period?
A new comparison period begins when liquidity leaves one set of price bounds and enters another. Record the tokens removed, fees collected, execution costs, and quantities deposited into the replacement range. Keeping the old range's entry values as if no state change occurred would combine two different exposures.
Does Collecting Uniswap v3 Fees Change the position's Price Range?
Collecting fees does not change a Uniswap v3 position's lower bound, upper bound, or active liquidity amount. It moves owed fee tokens to the recipient. Keep those collected tokens in the total-performance ledger, but do not treat collection alone as a rebalance or a new liquidity entry.
Could Token Decimal Handling Create a False Impermanent Loss Figure?
Incorrect decimal conversion can create a large but artificial shortfall. Normalize each raw token amount using that token contract's declared decimals before applying prices or comparing quantities. Check the network and contract address as well, because a shared symbol does not prove that two balances represent the same asset.