Skip to main content
Exchanges: CEX vs DEX

Liquidity Pools on DEXs

Pomegra Learn

Liquidity Pools on DEXs

Decentralized exchanges operate fundamentally differently from centralized platforms. Instead of matching buyers and sellers through an order book, DEXs use liquidity pools—smart contracts that hold pairs of tokens and automatically execute trades at algorithmically determined prices. This innovation removed the need for a centralized operator while introducing new opportunities and risks for token providers.

Quick Definition

Liquidity pool is a collection of cryptocurrency tokens locked in a smart contract that facilitates decentralized trading. Two or more token types are held in equal value, and traders exchange one token for another by interacting with the pool. Liquidity providers (LPs) deposit equal amounts of two tokens, receive LP tokens representing their share, and earn a portion of trading fees in exchange for their capital.

Key Takeaways

  • Liquidity pools replace order books: Instead of a central entity matching buyers and sellers, the smart contract automatically prices trades based on the ratio of tokens in the pool.
  • Liquidity providers are the market makers: Anyone can deposit tokens and earn trading fees proportional to their share of the pool.
  • Constant product formula: Most pools maintain the mathematical relationship: (Token A quantity) × (Token B quantity) = constant, determining prices algorithmically.
  • Price slippage increases with trade size: Large trades have worse prices because they move the ratio in the pool more dramatically.
  • Impermanent loss is a real cost: If token prices diverge after you deposit, you earn fees but may end up with fewer total dollars than if you'd simply held the tokens.
  • Lower fees than CEX but higher risks: DEX trading avoids intermediaries but exposes LPs to slippage, impermanent loss, and smart contract risk.
  • Pool composition matters: Different pools have different fee structures, token pairs, and liquidity levels; deeper pools = less slippage.

How Liquidity Pools Work: The Mechanics

The Constant Product Formula

The most common liquidity pool design uses a formula invented by Uniswap:

x × y = k

Where:

  • x = quantity of token A in the pool
  • y = quantity of token B in the pool
  • k = constant (remains the same after each trade)

Example: A pool holds 1,000 ETH and 20,000,000 USDC.

k = 1,000 × 20,000,000 = 20,000,000,000
Price = USDC/ETH = 20,000,000 / 1,000 = $20,000 per ETH

When a trader buys 100 ETH with USDC:

ETH remaining: 1,000 - 100 = 900
USDC required: k / 900 = 22,222,222.22
USDC spent: 22,222,222.22 - 20,000,000 = 2,222,222.22

Average price paid: 2,222,222.22 / 100 = $22,222 per ETH
(Higher than the $20,000 spot price due to slippage)

After the trade:

New pool state: 900 ETH, 22,222,222.22 USDC
k = 900 × 22,222,222.22 = 20,000,000,000 (constant maintained)

This algorithm automatically adjusts price based on supply and demand. As one token becomes scarcer, its price rises relative to the other token.

Liquidity Provider Role

To use a pool, it must contain both tokens. Liquidity comes from users who deposit equal values of both tokens and receive LP tokens (a claim on the pool's growth and fees).

Example: You deposit 1 ETH and 20,000 USDC into a new ETH/USDC pool.

Pool state after your deposit:
├─ ETH: 1
├─ USDC: 20,000
└─ LP tokens issued: 1,000 (arbitrary initial amount)

You receive 1,000 LP tokens representing 100% of the pool (since you're the only LP).

When another user deposits 1 ETH and 20,000 USDC:

Pool state after second deposit:
├─ ETH: 2
├─ USDC: 40,000
├─ Total LP tokens: 2,000
└─ Your share: 1,000 / 2,000 = 50%

Your LP tokens don't increase, but your share of future fees does. If $100 in trading fees accrue and you own 50% of the pool, you earn $50.

When you withdraw, you exchange your LP tokens for a proportional share of the pool. If the pool has earned $10,000 in fees, your 50% share is worth $10,000 + your original capital (minus impermanent loss).

Fee Structure

Liquidity providers earn fees from trades that use their capital. Fee structures vary:

  • 0.01% fee: For stable coin pairs (USDC/USDT) where price volatility is minimal
  • 0.05% fee: For medium-volatility pairs
  • 0.30% fee: Standard for most token pairs
  • 1.00% fee: For high-volatility or speculative pairs

Traders pay these fees when they swap. The fees accumulate in the pool and are distributed proportionally to LPs when they withdraw.

High-volume pools: A $100 million ETH/USDC pool with $10 million daily trading volume and a 0.30% fee earns $30,000 per day in fees. If you own 1% of the pool, you earn $300 daily.

Low-volume pools: A smaller pool with low trading activity earns few fees. LPs may earn less from fees than they lose to impermanent loss.

Visualizing Liquidity Pools

LIQUIDITY POOL STRUCTURE

┌────────────────────────────────────┐
│ ETH / USDC Liquidity Pool │
├────────────────────────────────────┤
│ │
│ Token A (ETH) Token B (USDC) │
│ 1,000 ETH 20,000,000 │
│ │
│ Spot Price: $20,000 per ETH │
│ Fee Tier: 0.30% │
│ 24hr Volume: $5,000,000 │
│ 24hr Fees: $15,000 │
│ │
├────────────────────────────────────┤
│ YOUR POSITION │
│ ├─ LP Tokens: 50,000 │
│ ├─ Your Share: 0.50% │
│ ├─ ETH Value: 5 ETH │
│ ├─ USDC Value: 100,000 USDC │
│ └─ Daily Fee Earnings: $75 │
└────────────────────────────────────┘

Price and Slippage in Liquidity Pools

Unlike centralized exchanges with an order book, DEX prices emerge from pool ratios. This creates slippage—the difference between expected and actual execution price.

Understanding Slippage

When you trade on a DEX:

  1. You specify the amount of token A you want to send
  2. The contract calculates token B output using the pool formula
  3. The actual price may be worse than expected if the pool is small or you're trading a large amount

Example:

Pool: 100 ETH / 2,000,000 USDC
Spot price: $20,000 per ETH

You want to buy 10 ETH.
Expected cost: 10 × $20,000 = $200,000
Actual cost after slippage: $204,081

Slippage: 2.04%
Slippage reason: Your 10 ETH purchase is large relative to the 100 ETH pool,
moving the ratio significantly.

Slippage is worse in:

  • Smaller pools (less liquidity)
  • Larger trades (relative to pool size)
  • Lower-volume tokens (less trading activity)

Slippage is better in:

  • Large, deep pools ($100M+ liquidity)
  • Smaller trades (< 1% of pool size)
  • Major token pairs (ETH, USDC, BTC)

Learn more about slippage mechanics

How Liquidity Pools Flow

Benefits of Liquidity Pools

No intermediary: Pools are smart contracts; nobody controls the funds or takes a cut beyond the algorithmic fee.

Permission-less participation: Anyone can deposit tokens and become an LP, earning fees proportional to their capital.

24/7 trading: DEX pools never close; trades settle in minutes regardless of time of day.

Price discovery through supply and demand: The constant product formula creates a fair price mechanism responsive to actual buying and selling pressure.

Composability: Liquidity pools integrate with other smart contracts, enabling complex strategies like flash loans, yield farming, and arbitrage bots.

Risks and Challenges for Liquidity Providers

Impermanent loss: If token prices diverge significantly, you end up with a lower total value than if you'd simply held the tokens. Read more

Example:

You deposit: 1 ETH ($20,000) + 20,000 USDC ($20,000) = $40,000 total

ETH price rises to $40,000.

If you'd held: 1 ETH ($40,000) + 20,000 USDC ($20,000) = $60,000

Your LP position: 0.71 ETH ($28,571) + 28,284 USDC ($28,284) = $56,855

Loss: $60,000 - $56,855 = $3,145 (5.2% impermanent loss)
You earned fees, but it may not fully offset this loss.

Smart contract risk: The pool contract could have bugs, allowing theft or fund loss. Audited contracts reduce (but don't eliminate) this risk.

Temporary price impact: Your deposit or withdrawal changes pool ratios, potentially moving prices against you.

Concentration risk: If you deposit significant capital into a small pool, your withdrawal could be slippery and costly.

Common Liquidity Pool Strategies

Passive LPing: Deposit tokens, hold LP tokens, collect fees monthly. Suitable for long-term believers in both tokens.

Active rebalancing: Monitor your position; withdraw and redeposit if the ratio diverges too far from your risk tolerance.

Liquidity farming: Deposit into pools that offer extra incentives (additional token rewards from the protocol). Earn base fees + farming rewards.

Market-neutral pairs: Deposit equal values of correlated tokens (e.g., two stablecoins) where impermanent loss is minimal and fee collection is the primary return.

Yield layering: Deposit into a yield farm for farming rewards, then stake those rewards in another protocol. Multiple layers of income but high complexity and risk.

Common Mistakes

"I'll deposit into a pool with a new, unaudited token." Unaudited smart contracts can have exploitable bugs. Stick to established, audited pools until you understand contract security deeply.

"High APY = good returns." High annual percentage yield (APY) often reflects high fee tiers (high risk) or unsustainable farming rewards. Calculate your actual dollar returns, not just percentages.

"I'll deposit huge amounts into a small pool." Large positions in small pools expose you to severe slippage when you withdraw. Start small and scale slowly.

"My LP tokens are always worth the same as my initial deposit." LP tokens represent a share of the pool, which grows or shrinks with trading activity, impermanent loss, and fees. Don't assume constant value.

"I don't need to track my LP position." Withdrawing at the wrong time (peak divergence) can crystallize large impermanent losses. Monitor your position regularly.

Frequently Asked Questions

How much do I earn as a liquidity provider?

Depends on: pool trading volume, your share of total liquidity, the fee tier, and impermanent loss. A 1% share of a highly-traded ETH/USDC pool at 0.30% fees with $1M daily volume earns ~$30 daily, minus impermanent loss. Low-liquidity pools may earn very little.

Can I withdraw my liquidity anytime?

Yes, liquidity pools are permissionless. You can withdraw instantly by exchanging your LP tokens for the underlying tokens. However, if the pool ratio has moved against you (impermanent loss), you may withdraw less total value than you deposited.

What's the difference between being an LP and holding the tokens?

LPs earn trading fees but incur impermanent loss if prices diverge. Holders avoid impermanent loss but earn no fees. Over time, LPing outperforms holding if fee income exceeds impermanent loss.

How do I know if a pool is safe?

Check: Is the smart contract audited (Certik, Consensys, others)? What's the pool age and track record? Does the team have a reputation? Is the pool on an established DEX (Uniswap, Balancer)? Use caution with new tokens or unaudited contracts.

What's the "TVL" metric I see on liquidity pools?

Total Value Locked (TVL) is the total dollar value of tokens deposited in the pool. Higher TVL = more liquidity = less slippage for traders. A $1B TVL pool is generally safer than a $1M pool.

Should I provide liquidity in volatile token pairs?

Volatile pairs offer higher fees (1.00% tier) because traders expect more slippage, but impermanent loss risk is very high. Profitable only if trading volume is exceptionally high or if you accurately predict price ranges.

Summary

Liquidity pools are the engine that powers decentralized exchanges. Instead of relying on order books and centralized matching, DEXs use the constant product formula to automatically price trades and facilitate exchanges. Anyone can become a liquidity provider by depositing two tokens in equal value and earning a portion of trading fees.

The tradeoff is real: LPs earn fees, but they accept price slippage for traders and impermanent loss risk if token prices diverge. Understanding both the mechanics and risks is essential before depositing significant capital. Start with established, audited pools, monitor your position regularly, and remember that high APY often signals high risk, not guaranteed returns.

Next

Slippage in Crypto Trading