How do liquidity pools work?

How do liquidity pools work?

Liquidity pools are the mechanism that powers automated market makers (AMMs) — the tech behind DEXs like Uniswap, Raydium, and PancakeSwap. Here's how they work.

The basic idea

Instead of matching a buyer with a seller (like a traditional exchange order book), a liquidity pool pairs a token with a base asset (usually a stablecoin or the chain's native token) in a shared reserve. When you trade, you don't trade with another person — you trade against the pool itself.

Liquidity providers (LPs) deposit both tokens into the pool. In return they get LP tokens, which represent their share of the pool and entitle them to a cut of the trading fees.

The pricing formula

Most pools use the constant-product formula: x × y = k

  • x = amount of token A in the pool
  • y = amount of token B in the pool
  • k = a constant that must stay the same

If someone buys token A, they put in more token B, which makes y rise and x fall. Because x × y must stay equal to k, the price of A automatically adjusts upward. The bigger the trade relative to the pool size, the more the price moves (slippage). This is why deep pools with lots of liquidity give better prices than shallow ones.

Impermanent loss (the catch)

When the price of one token changes a lot relative to the other, LPs can end up worse off than if they'd just held both tokens. That's called impermanent loss — the pool holds less of the token that went up in value. The trading fees you earn are meant to compensate for this risk, but they don't always cover it during volatile markets.

The trade-offs

  • Advantage over order books: anyone can provide liquidity from anywhere, no centralized matching engine, trades are permissionless and always possible (as long as there's liquidity).
  • Risks: impermanent loss, plus pool-specific dangers like a rug pull — when a developer removes the locked liquidity, leaving the pool with nothing and making LP tokens worthless. This is why the liquidity-lock status of a pool is such a critical thing to check before providing liquidity to a new token.

If you're curious about a specific pool or DEX, I can pull live data — for example, the current liquidity, lock status, and fee structure of a particular token's pool, or a ranking of the biggest DEXs and their trading volumes. Just say the word.

Generated September 1, 2026 byCoinAII — not financial advice.