Trading Dev AcademyFree quant education

Free lesson · DeFi models

LP value versus holding the original tokens

Open interactive lessonPractice calculationsExplore labs

Start with the idea

A liquidity provider can make money in dollars while underperforming a passive holding of the initial tokens. The benchmark must be named.

Symbols, units & horizon
  • r: final base price divided by initial base price, positive and dimensionless
  • IL: relative value difference versus holding original tokens
  • no-fee, full-range constant-product pool
  • one terminal comparison

When and why to use this

Compare LP terminal value with a transparent buy-and-hold benchmark before adding fee income.

A liquidity provider can make money in dollars while underperforming a passive holding of the initial tokens. The benchmark must be named.

Start with equal-value base and quote reserves in a no-fee constant-product pool. After a price ratio change r, pool value grows with the square root of r while the original holdings have one asset growing with r.

The commonly called impermanent-loss ratio compares these two terminal values. It excludes fees and is not loss-versus-rebalancing, which uses a dynamically rebalanced benchmark. The underperformance can become realized when the position closes.

IL(r)=2r1+r−1
Model assumptions, derivation and arithmetic

LP value versus holding the original tokens

  1. Normalize initial reserve values to one quote unit on each side.
  2. After price ratio r, passive holdings are worth 1+r while aligned pool value is 2√r.
  3. Divide pool by hold value and subtract one.
Work it by hand

If base price doubles, r=2. Pool/hold=2sqrt(2)/3≈.942809. Relative underperformance is −.057191, or −5.7191%, before fees.

Apply it in a strategy

  • Compare LP terminal value with a transparent buy-and-hold benchmark before adding fee income.
  • Record the input timestamp, executable quantity, currency and horizon. Reconcile the result with a cash-flow or state table.
  • Stress this failure condition: This no-fee full-range ratio cannot be applied unchanged to concentrated liquidity, rebalancing or path-dependent fee income.

Research deliverable

Build and explain a lp value versus holding the original tokens worksheet. Compare LP terminal value with a transparent buy-and-hold benchmark before adding fee income.

Evidence boundary: Synthetic arithmetic and scenarios illustrate mechanics. They are not historical returns, a paper replication, or evidence of an executable edge. Research sources and their access limitations are recorded at the end of this module.

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

# Python 3.10+; standard library unless NumPy is imported below.
# Inputs and outputs use the units defined in this lesson. Synthetic teaching example.
from math import sqrt
def holding_difference(price_ratio):
    if price_ratio<=0: raise ValueError("Positive price ratio required")
    return 2*sqrt(price_ratio)/(1+price_ratio)-1

print(holding_difference(2))

Continue learning

DeFi: AMMs, Liquidity Provision and Lending — all lessons
  1. Constant-product swaps with an input fee
  2. LP inventory after price changes
  3. LP value versus holding the original tokens
  4. Concentrated liquidity and range boundaries
  5. LVR and the price of stale inventory
  6. Lending utilization and rate response
  7. Collateral health factor and correlated shocks
  8. Liquidation incentives after execution costs

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations