Loading prices…

What Is a Liquidity Pool? How AMMs Work in Plain Math

Liquidity pools replace the matchmaker in a traditional exchange with a pile of two assets and a formula. Here is how AMMs price trades, what slippage really is, and what you sign up for when you become an LP.

What Is a Liquidity Pool? How AMMs Work in Plain Math

What it really is

Before AMMs, every crypto trade needed a matched orderbook — a buyer and a seller agreeing on a price. That worked for major pairs on centralized exchanges, but it broke down on-chain: thin order depth, slow blocks, and no one wanting to be the market maker for a brand-new token.

Liquidity pools replaced the matchmaker with math. A liquidity pool is a smart contract that holds a pool of two (sometimes more) tokens — say ETH and USDC. Anyone can deposit a balanced amount of both sides; anyone can trade one for the other. The contract calculates the price from the ratio of reserves, charges a small fee per swap, and pays that fee to the people who deposited. No orderbook. No counterparty. Just code and reserves.

This pattern, popularized by Uniswap, is the foundation under every DEX, every farm, every yield farming strategy, and almost everything in DeFi that involves moving from one token to another.

How it actually works

Let's walk a single trade through a pool to make this concrete.

A pool starts with 10 ETH and 40,000 USDC. The implied price is 40,000 / 10 = 4,000 USDC per ETH.

A trader wants to swap 1 ETH for USDC. The pool adds 1 ETH to its ETH reserve (now 11 ETH) and pays out enough USDC to keep the constant-product formula x × y = k intact. With k = 10 × 40,000 = 400,000, the new USDC reserve must be 400,000 / 11 ≈ 36,363.6. So the trader gets 40,000 - 36,363.6 ≈ 3,636.4 USDC for their 1 ETH.

Notice that they got less than 4,000 — the headline price. That gap is slippage: the trade itself moved the pool's ratio, and bigger trades against the same pool slip more. The pool has effectively re-priced ETH after the swap: ETH is now scarcer relative to USDC, so the new implied price is 36,363.6 / 11 ≈ 3,305 USDC per ETH. Arbitrageurs will trade in the opposite direction whenever this drifts far from the external market price, which is how AMMs stay roughly aligned with reality.

Where the fee fits in

Each pool charges a small fee per swap — 0.05% to 1% depending on the pool — paid to liquidity providers pro-rata to their share. The fee is taken out of the trader's input before the formula is applied, so it accumulates inside the pool over time and the LP's share gradually grows.

Simple example with numbers

Suppose you become an LP in the ETH/USDC pool above with 1 ETH and 4,000 USDC ($8,000 total at the time, assuming 1 ETH = $4,000).

The pool issues you an LP token representing your share — say 10% if you happened to be 10% of the pool's value. From that moment on:

  • Every swap pays you 10% of the fees collected on that trade.
  • Your share of the pool's reserves rises and falls with each swap, because the pool rebalances around the formula.
  • If ETH's market price moves significantly relative to USDC, arbitrageurs realign the pool — and your dollar value as an LP diverges from what it would have been if you had just held the two tokens separately. That divergence is impermanent loss, and it deserves its own page.

When you want out, you redeem your LP token for your current share of the pool — whatever ratio of ETH and USDC the pool happens to be holding at that moment, plus the fees accumulated.

The mechanics behind

The x × y = k formula

The constant-product formula is the simplest AMM design — Uniswap V2 made it famous. The product of the two reserves stays constant after every trade, before fees. The implication: pools are infinitely liquid (you can always trade any size), but the price you receive worsens as your trade gets bigger. This is a feature, not a bug — it forces traders to pay for the price impact they create.

Many newer pools use different formulas tuned for specific use cases:

  • Stable pools (Curve, Uniswap V3 stable) use formulas that hug the 1:1 line tightly, so stablecoin swaps barely slip.
  • Weighted pools (Balancer) hold three or more assets at fixed weight ratios (e.g. 80/20).
  • Concentrated liquidity (Uniswap V3) lets LPs pick the price range where their capital is active, dramatically improving fee yield within that range — at the cost of more sophisticated management.

All of these are still pools under the hood. The formula just decides how the reserves respond to trades.

LP tokens are tradable, composable receipts

An LP token is an ERC-20 (or equivalent) representing your share. Because it is a regular token, you can do things with it: stake it in a farm to earn extra rewards, use it as collateral in another protocol, or transfer it to someone else. This composability is why DeFi feels like Lego: an LP token from one protocol becomes the input to another.

Why pools need both sides

When you become an LP, you deposit both tokens in the current pool ratio. You cannot deposit only ETH — the contract will not accept an unbalanced deposit because it would shift the price. If you only hold one side, you sell half of it for the other and then deposit. Most DEX UIs do this swap for you automatically and warn about the slippage cost.

The risks worth knowing

  • Impermanent loss. The fundamental cost of being an LP. If the two tokens diverge in price, your dollar value can end up below what "just holding" would have produced. We dedicate a full guide to it: what is impermanent loss.
  • Smart contract risk. A bug in the pool's contract — or in something it calls — can drain funds. Pools rely on years of audits, but no audit is a guarantee. Stick to pools on protocols with a long track record when meaningful capital is on the line.
  • Stablecoin depeg risk in "stable" pools. Stable pools look the safest until one of the stables loses its peg. The formula then rebalances you into the depegged asset, often at the worst moment.
  • Sandwich and MEV attacks. Predictable swaps can be sandwiched by bots that trade just before and just after your transaction, extracting value. Many UIs now support private mempools or slippage caps to mitigate this.
  • Reward dilution. If you provided liquidity for the rewards (an emissions-driven farm), more LPs joining means each LP gets a smaller slice, and the reward token's price often falls too.

None of this is financial advice. Pools are a powerful primitive, but they have a different risk profile from holding the underlying tokens — usually more risk, sometimes meaningfully more.

Who it actually suits

Becoming an LP suits people who already understand the underlying assets, can model impermanent loss for a price scenario, and want exposure to swap-fee revenue. Stable-to-stable pools (e.g. USDC/USDT) are usually the gentlest entry — fees are smaller but impermanent loss is minimal as long as both pegs hold. Volatile pairs (ETH/some altcoin) earn more fees but expose you to material impermanent loss if the altcoin trends strongly.

Who it does not suit: anyone treating LP yield as risk-free income; anyone who deposits without understanding what the underlying tokens are; anyone chasing a 200% APR on an unfamiliar pair on a protocol they cannot name. The pools doing the most spectacular short-term yields are usually the riskiest by a wide margin.

Watch the pool flows, watch the news

Pool dynamics shift with each new protocol upgrade, exploit, depeg, and large position entry — all of which surface in DeFi headlines before TVL dashboards catch up. Zippfeed tracks DeFi, security, and protocol headlines with sentiment and importance scoring, so you can see exploits, depegs, and major migrations early. Useful context whether you are actively LPing or simply trying to understand why prices on a particular DEX moved in a way that the external market did not.

Frequently asked questions

What is a liquidity pool in DeFi?
A liquidity pool is a smart contract that holds a balanced amount of two (or more) tokens, letting anyone swap one for the other at a price set by a formula rather than a matched orderbook. It is the core building block of automated market makers like Uniswap, Curve, and Balancer.
How does the x times y equals k formula work?
It is the constant-product formula behind classic AMMs. The pool's two reserves multiply to a constant k that must stay the same after every trade. As a trader takes one token out, they put more of the other in — and the formula re-prices the pool. Bigger trades against the same pool slip more in price.
Can you lose money in a liquidity pool?
Yes. Beyond smart contract risk, every LP is exposed to impermanent loss — if the two tokens diverge in price, your dollar value can end up below what simply holding them would have produced. Fees can offset this, but on volatile pairs they often do not. None of this is financial advice.
What is an LP token?
When you deposit into a liquidity pool, you receive an LP token (ERC-20 or equivalent) that represents your share of the pool's reserves and fees. You can redeem it later for your share of the pool's current state, stake it in a farm for extra rewards, or use it as collateral in other DeFi protocols.