Liquidity Pools, AMMs & Impermanent Loss.

Liquidity Pools, AMMs & Impermanent Loss

Beginner
DeFi
• ~10 min read
• Updated: 08/08/2025


1) What is a Liquidity Pool?

A liquidity pool (LP) is a smart contract that holds two (or more) tokens
so people can swap between them at any time. Instead of matching buyers and sellers, the AMM quotes a price from the pool’s balances.

When you deposit both tokens, you become a Liquidity Provider (LP) and receive LP tokens
that represent your share of the pool. You earn a cut of swap fees.

2) The AMM pricing curve: x · y = k

In the classic Uniswap v2 model, if a pool holds token A amount x and token B amount y, the product
k = x · y stays constant (ignoring fees). A trade moves along this curve.

Start:  x = 100 A,  y = 100 B   →  k = 10,000
Buy A:  trader adds B and removes A, so y increases, x decreases
Price A in B ≈ y / x  (slope of the curve near current point)

Concentrated liquidity (Uniswap v3) lets LPs choose price ranges to deploy capital for higher efficiency.

3) Where fees come from

Each swap pays a small % fee (e.g., 0.05%–1%). Those fees stay in the pool and increase the value of LP shares.
Your earnings = your pool share × accumulated fees.

4) Impermanent Loss (IL) explained

Impermanent Loss is the value difference between:

  1. Holding tokens in your wallet, versus
  2. Providing those tokens as liquidity in an AMM

When the relative price between the two tokens changes, the AMM rebalances your position.
If you withdraw, you may end up with more of the underperforming asset and less of the outperforming asset, even though you earned fees. The “loss” can become permanent when you withdraw.

Example (simplified):
- You deposit 1 ETH @ $3,000 and 3,000 USDC into a 50/50 pool.
- ETH doubles to $6,000.
- In the pool, arbitrage trades push the balances until price matches spot.
- You withdraw fewer ETH + more USDC than if you'd simply held.
- Fees may offset some (or all) of the IL depending on volume.

5) How to reduce impermanent loss

  • Provide liquidity to stable pairs (e.g., USDC/DAI)  prices move together.
  • Use concentrated ranges only if you can rebalance; tighter ranges earn more fees but require active management.
  • Prefer assets you’re happy holding long-term regardless of price moves.
  • Consider protocols with IL protection or dynamic fees (some DEXes adjust fees with volatility).
  • Factor in gas costs when compounding or moving positions.

6) Other risks to know

  • Smart contract risk: Bugs/hacks can drain pools.
  • Oracle/manipulation: Thin liquidity can be exploited around price updates.
  • Regulatory & counterparty risks for certain tokens/pools.
  • Volatility whiplash: Wide price swings can increase IL significantly.

7) Further learning & resources

  • Uniswap Docs  AMM design, v2/v3 mechanics.
  • Curve Whitepaper  stable-swap curve (low IL for like-pegged assets).
  • Balancer  multi-asset pools and custom weights.
  • Cyfrin Updraft  Deep dives into secure smart contract development (great for LP/DEX internals).
  • Paradigm Research  AMM theory & papers.

← Anatomy of an Ethereum Transaction
Staking & Restaking: Risks and Rewards →