What Is a Liquidity Pool? How AMMs Work Under the Hood (DeFi 2026)
A liquidity pool is a smart contract that holds two (or more) tokens in a paired pool, letting anyone trade between them without needing a matching buyer or seller. Instead of an order book, prices are determined by a mathematical formula based on the ratio of tokens in the pool โ most commonly x ยท y = k (Uniswap V2's constant product). When you swap on Uniswap, you don't trade with another person โ you trade with the pool itself, and the pool automatically adjusts its price based on your trade size.
This guide explains liquidity pools from scratch: why DEXs use them instead of order books, the x ยท y = k math with a worked example, how Uniswap V3's concentrated liquidity changes everything, what LP tokens are, how providers earn fees, and the risks (impermanent loss, smart contract bugs, rugged pools). We link to an interactive simulator where you can see the bonding curve move in real time.
Updated May 2026. Includes V4 PoolManager and hooks architectural context.
Why DEXs use pools instead of order books
Traditional exchanges (Coinbase, Kraken, Binance) use order books โ sellers post offers at various prices, buyers post bids, the exchange matches them. This works well for high-liquidity markets but requires a centralized intermediary running the matching engine.
On-chain, running an order book is computationally expensive. Every order placement and cancellation is a transaction with gas cost. For low-volume tokens, the market would dry up โ no one wants to post limit orders for tiny altcoins. The 2018 invention of Automated Market Makers (AMMs) solved this by replacing the order book with a smart contract holding both tokens. Now anyone can swap by interacting with the contract โ instant liquidity for any pair as long as someone has deposited both sides.
How constant product x ยท y = k actually works
In a Uniswap V2 ETH/USDC pool, suppose the pool starts with 100 ETH (x) and 200,000 USDC (y). The invariant: x ยท y = k = 20,000,000. Pool price = y / x = $2,000 per ETH.
Now you want to swap 1 ETH for USDC. The contract enforces x ยท y = k. After your swap: new_x = 101, so new_y = 20,000,000 / 101 = 198,019.8. You receive 200,000 - 198,019.8 = 1,980.2 USDC. Your effective price: 1,980.2 USDC per ETH โ slightly worse than the pre-trade $2,000 due to slippage.
The bigger your trade relative to pool size, the worse your effective price. Try the interactive Uniswap V2 simulator and slide the swap amount from 0.5 ETH to 200 ETH to see the bonding curve move dramatically.
How liquidity providers earn fees
When you deposit tokens into a pool, you receive LP tokens โ proof of your share. Every swap charges a fee (0.3% on Uniswap V2, 0.05-1% on V3 by tier) that's added to the pool reserves. Your LP tokens are now worth more.
Real-world example: in the USDC/ETH 0.05% pool on Uniswap V3, daily volume of $200M generates $100k in fees. If you're 1% of the pool's liquidity, you earn $1,000/day in fees. Annualized that's 365% โ far higher than any bank yield. But there's a catch: impermanent loss. When the price moves significantly, your LP value can fall below what you'd have made just holding the two tokens โ a hidden cost we cover in our impermanent loss article.
Uniswap V2 vs V3 โ what changed?
V2's constant product spreads liquidity across infinite price range (from $0 to infinity per ETH). In practice, most trading happens in a narrow band โ V2 wastes most capital. V3 introduced 'concentrated liquidity': LPs pick a price range [Pa, Pb] where their tokens are active. Inside the range, your capital does 100-4000ร more work than V2.
Trade-off: if price moves outside your range, your position is 100% in the worse-performing asset and earns zero fees until price returns. V3 LPs need active management โ narrow ranges + bots, or wider ranges + less efficiency. Try the V3 simulator to drag a position range and watch the histogram of liquidity distribution.
What are LP tokens and how do they work?
When you provide liquidity, the contract mints you LP tokens (in V2 these are ERC-20 tokens called 'Uniswap V2 LP'). They represent your share of the pool. To withdraw your liquidity, you burn (return) the LP tokens, and the contract gives you back your share of the current reserves.
LP tokens are themselves valuable. You can stake them in 'farms' (Sushiswap, Convex) to earn additional rewards on top of the swap fees. This is the foundation of 'yield farming'. In V3, LP positions are NFTs instead of fungible tokens โ each LP position has a unique range, so they can't all be interchangeable.
Risks of providing liquidity
Three main categories:
- Impermanent loss โ when prices diverge, your LP value lags behind HODL. At 2ร price move IL is 5.7%; at 4ร it's 20%; at 10ร it's 42%.
- Smart contract risk โ bugs in the pool contract or governance vulnerabilities can drain funds. Pick established protocols (Uniswap, Curve) with audits + long uptime.
- Rug pull risk โ for pools created by anonymous teams (especially newly-launched memecoins), the team can drain the pool by removing all liquidity. Only LP into pools with locked liquidity.
Best practices for liquidity providers
- Start with stable-stable pools (USDC/USDT) โ IL is near zero, yields are 3-10% APY. Boring but profitable.
- Move to ETH/stETH or BTC/WBTC type correlated pairs โ minimal IL, slightly higher yield.
- Only LP into pools with $5M+ TVL on established protocols. Smaller pools = higher IL volatility + higher rug risk.
- Use V2 (full range) until you understand V3 trade-offs. V3 narrow ranges require active management or you'll lose to V2 LPs.
- Track your position weekly using DeBank or Zerion. Most LPs lose money because they forget about their position and let bad market conditions drain it.
Uniswap V4 hooks โ the next evolution
Uniswap V4 (launched 2024) keeps the V3 concentrated liquidity model but adds 'hooks' โ custom smart contract logic that runs before/after pool actions. Examples: dynamic fees that respond to volatility, MEV protection that batches swaps, custom curves that aren't constant-product.
For most users, V4 looks similar to V3 from the trading side. The change is for builders โ V4 makes it dramatically easier to launch specialized pools. Try the V4 hooks simulator to see how toggling hooks changes a swap's behavior.
Frequently asked questions
+What's the difference between a liquidity pool and a regular exchange?
A regular exchange (CEX) uses an order book โ matching buyers and sellers. A liquidity pool (DEX/AMM) uses a smart contract holding both tokens โ you trade with the contract, not another person. AMMs offer instant liquidity for any pair as long as someone deposited it; CEXs require active matching.
+Can I lose all my money in a liquidity pool?
Yes, in three ways: (1) one of the paired tokens goes to zero โ your LP position becomes 100% of the worthless token; (2) the smart contract has a critical bug that gets exploited; (3) the pool is a scam with unlocked liquidity that gets rugged. Pick established pools to mitigate.
+How much can I earn from being a liquidity provider?
Varies wildly by pool. Stable-stable on Curve: 3-10% APY. ETH/USDC on Uniswap V3 narrow range: 30-100% APY but with significant IL risk. Long-tail altcoin pools: 100-1000% APY but extreme IL risk.
+What's the minimum to provide liquidity?
Technically nothing โ you can LP any amount. Practically, gas fees on Ethereum mean amounts under $500 lose most of their first year's yield to gas. On Polygon, Arbitrum, Base, Solana: $50-100 minimum makes economic sense.
+Are liquidity pools insured?
No standard insurance. Some protocols (Nexus Mutual) offer optional smart-contract insurance. Major pools like Uniswap have been operational for 5+ years without exploits โ track record is the closest thing to insurance.
+Can I just provide one token to a pool?
Standard AMMs require both tokens at the current ratio. Single-sided LP options exist (Bancor, some V3 strategies) but with different risk profiles. For beginners, two-sided LP is the default.
+Do all DEXs use the xยทy=k formula?
No โ many alternatives exist. Curve uses StableSwap (a hybrid curve optimized for low-slippage stable trades). Balancer uses weighted pools (50/50, 80/20, etc.). Maverick uses 'modes' that auto-rebalance. Uniswap V2's xยทy=k is the simplest and most common.
+What chain has the most liquidity pools?
Ethereum has the most TVL ($60B+ across DEXs in 2026). Solana has the most pool creation activity (memecoins). BNB Chain has the most retail-trader pools. Pick based on the assets you want to trade โ major pairs exist on most chains.
Related tools
Related articles