Impermanent Loss: Inputs and Comparison Boundaries
Calculate liquidity-position divergence against an explicit holding benchmark, and keep fees, cash flows and realised withdrawals separate from the comparison.

Overview
When translating these concepts into an integration, keep the scope described by the wallet history api with the result. The examples in wallet transaction history and smart contract event logs show how the same distinction affects neighbouring data questions.
Impermanent loss usually compares a liquidity position with a specified hold-only benchmark. The result depends on starting quantities, price path assumptions and position design. It is not the same as an absolute cash loss.
Define the counterfactual
Choose the initial assets and quantities, valuation currency and comparison time. Compare like-for-like exposure under a declared model. A constant-product full-range example should not be applied unchanged to a concentrated-liquidity position. Deposits, withdrawals and fee reinvestment also change the baseline.
Worked example: both values can rise
A hold-only benchmark grows from a value of one hundred to 150. The comparable liquidity position is worth 140 before separately counted fees. Its divergence is negative ten in value, even though the position increased from one hundred. Presenting this as a ten-unit absolute loss would answer the wrong question.
Keep components auditable
Store benchmark quantities, selected prices, position calculations and cash-flow adjustments. Show fees separately or explicitly state that they are included. Test partial withdrawals and unavailable historical prices. If the baseline cannot be reconstructed, report an incomplete comparison instead of inferring original quantities from the current position.
A practical acceptance test
Set the benchmark value to 150 and comparable position value to 140 after both began at one hundred. Assert a ten-unit benchmark shortfall and a positive forty-unit absolute change before separately considered costs. The labels must distinguish those measures. Add an external deposit and require a revised baseline rather than applying the old comparison unchanged.
Questions about the topic
Frequently asked questions
Does impermanent loss always mean the position lost money?
No. It is a comparison with a benchmark, not necessarily a negative absolute return.
Can fees offset the comparison difference?
They can affect total performance, but their inclusion must be stated.
Standards & technical documentation