Skip to main content

Impermanent Loss

Impermanent loss (IL) is the difference in value between holding tokens in a liquidity pool versus simply holding them in a wallet. It occurs whenever the relative price of the pooled tokens changes from the ratio at which you deposited.

How Impermanent Loss Works

In a Constant Product (x * y = k) pool, arbitrageurs continuously rebalance the reserves to match the external market price. When the price of one token rises relative to the other, the pool ends up holding more of the depreciating token and less of the appreciating one. The net effect is that your position is worth less than if you had held both tokens outside the pool.

The loss is called "impermanent" because it reverses if the price ratio returns to its original value. However, if you withdraw while the ratio has diverged, the loss becomes realized.

IL Formula

For a price change factor r (new price / original price):

IL = 2 * sqrt(r) / (1 + r) - 1
Price ChangeImpermanent Loss
1.25x-0.6%
1.50x-2.0%
2.00x-5.7%
3.00x-13.4%
5.00x-25.5%

Built-In IL Calculator

QsnDEX includes an impermanent loss simulator directly in the platform interface.

API Endpoint:

GET /api/il/simulate?priceChange=<factor>&principal=<amount>

Parameters:

  • priceChange -- the ratio of new price to original price (e.g., 2.0 for a 2x price increase).
  • principal -- the initial USD value of the position.

The response includes the IL percentage, the value if held in pool, and the value if held in wallet.

Visual IL Curve

The simulator renders an interactive IL curve chart. The x-axis represents the price change factor and the y-axis shows the percentage loss. A highlighted point on the curve updates in real time as you adjust the price change slider.

Price Change Slider

Use the slider to model different price scenarios. The interface updates all values live:

  • New token balances in the pool
  • Position value in the pool vs. holding
  • Impermanent loss in both percentage and absolute terms

Breakeven Analysis

The calculator also estimates the breakeven point: the amount of fee revenue your position must earn to fully offset the impermanent loss at a given price change. This helps you evaluate whether the expected trading fees justify the IL risk for a specific pool and time horizon.

StableSwap Pools and IL

Pools using the StableSwap curve (A = 85) experience significantly lower impermanent loss for assets that remain near their peg. Because the curve concentrates liquidity around a 1:1 ratio, small deviations in price produce much less rebalancing than in a standard Constant Product pool. For stablecoin and correlated-asset pairs, StableSwap pools are the recommended choice to minimize IL exposure.