DeFi

Impermanent Loss

Impermanent loss is the difference between holding assets in an AMM pool and holding the same assets outside the pool after relative prices move.

Impermanent loss is what an LP loses compared with simply holding when pool prices move.

Impermanent Loss Explained in Detail

Impermanent loss compares two outcomes: providing assets to an AMM pool versus holding those assets outside the pool. When relative prices move, the pool rebalances the LP's exposure.

Fees can offset the loss, but the loss matters when protocols value LP positions or promise returns.

Smart contract example

LP value after price move < hold value after price move

This comparison is economic, but it can affect smart contract accounting.

Impermanent Loss in Auditing

Impermanent loss becomes a security issue when protocols use LP tokens as collateral, calculate strategy profits, or promise principal protection without accounting for price movement.

Auditors review whether LP valuation can be manipulated or misunderstood.

Red flags in code

  • LP tokens are valued only from spot reserves.

  • Principal preservation is assumed without proof.

  • Fees are counted as profit while price exposure is ignored.

  • Withdrawal accounting hides losses.

  • Oracle design does not handle pool manipulation.

How to test or review it

  • Simulate large price moves in both directions.

  • Compare LP value with hold value.

  • Manipulate reserves before deposit, withdrawal, or borrow actions.

  • Test low-liquidity and high-volatility cases.

  • Review how fees, losses, and share price are reported.

Sources