Jump to content

track

Liquidity Pools

How crypto liquidity pools set prices with the constant product and StableSwap formulas, where swap fees go, and what liquidity providers really earn.

2 pulses · latest Oct 21 · Wed

A hand tips a scoop of gold and silver coins into a glass jar on a dark wooden table.

Photo: Rdne on Pexels

A liquidity pool is a smart contract that holds two or more tokens and lets anyone swap between them at a price set by a formula instead of an order book. People who deposit the tokens, liquidity providers, earn a share of the swap fees. The formula decides the price, and the price decides what an LP's share is worth.

How does a liquidity pool set the price?

Most volatile-pair pools use the constant product rule, x times y equals k: the pool holds amounts x and y of two tokens and keeps their product constant through every swap, before fees. Buy one token and its balance in the pool falls, so its price in terms of the other rises. The bigger the trade relative to the pool, the further the price moves. That is where price impact comes from, and why a deep pool quotes better prices than a shallow one. Our liquidity pool math read works a single pool through a swap step by step.

Where do swap fees go?

Each swap pays a fee, a fixed percentage of the trade set by the pool's fee tier. The fee stays in the pool, so the LP tokens that represent a share of the pool slowly claim more of each asset. Some protocols can divert part of that fee to the protocol itself, which lowers what LPs keep. Fee income is the only reason to provide liquidity, and it has to outrun the cost covered in our impermanent loss lane.

Why do stablecoin pools use a different formula?

Two stablecoins meant to trade at the same value do not need a curve that lets the price drift far. Curve's StableSwap invariant blends a constant sum curve, which holds the price flat, with a constant product curve, which takes over as a pool becomes lopsided. The result is very low slippage near the peg. The risk is the depeg: when one coin loses its peg, traders sell it into the pool, and LPs end up holding mostly the weakest coin. Our read on stablecoin liquidity pools shows how that happens.

What should a new LP check first?

The fee tier, the depth and trading volume of the pool, which tokens it pairs, whether liquidity is concentrated in a price range, and what the protocol takes. Each changes the return more than any headline yield figure.

How PolyCasino covers liquidity pools

We work from the protocols' own whitepapers and docs, with a numeric example in every pulse. Nothing here is investment advice. Start with the pool math, then the stablecoin read.

Latest in Liquidity Pools

every pulse on this track, newest first