Jump to content
deep cut

Liquidity Pool Crypto Math: Price, Fees and LP Share Value

A 100 ETH / 10,000 DAI pool worked through the constant product formula: how swaps set price, where the 0.30% fee goes, and why LPs trail holders.

PolyCasino Chain Pulse · 6 min read

pass it on

A liquidity pool in crypto is a smart contract holding two tokens that traders swap against, with the price set by a formula instead of an order book. In a Uniswap v2 pool that formula keeps the product of the two reserves constant, so buying one token makes it dearer, and every swap pays a fee into reserves that liquidity providers (LPs) own pro rata. The catch, worked through below, is that each trade rebalances an LP's share, which is why it can end up worth less than just holding the tokens.

How does a liquidity pool work?

A pool prices a swap by keeping x times y equal to a constant k, where x and y are its two reserves. Traders add one token and remove the other, and the size of the trade relative to the reserves decides how far the price moves.

There is no counterparty on the other side of your order. The contract is the market maker, which is why these exchanges are called automated market makers (AMMs). The price is simply the ratio of the reserves: a pool with more DAI per ETH quotes ETH higher. Push ETH out of the pool and the remaining ETH gets scarcer, so the next unit costs more. That is slippage, and it is the formula working as designed.

The constant product is not the only curve. Balancer's weighted math generalises the formula so a pool can hold tokens in uneven weights rather than an even split, but the logic is the same: the invariant holds and the price falls out of the reserves.

Worked example: the constant product formula with numbers

The cleanest numbers come from Uniswap's own returns walkthrough. Start with a pool of 100 ETH and 10,000 DAI, so the price is 100 DAI per ETH and k is 100 times 10,000, or 1,000,000. An LP deposits 1 ETH and 100 DAI, which is 1% of the pool.

Now outside markets move ETH to 120 DAI, and arbitrage traders swap until the pool quotes the same price. The reserves have to satisfy two conditions at once: their product is still 1,000,000 and their ratio is 120. The docs solve it as ETH reserve equals the square root of k over price, which gives about 91.2871 ETH and roughly 10,954 DAI.

PositionETHDAIValue at 120 DAI per ETH
Whole pool after the move91.2871about 10,954about 21,909 DAI
LP's 1% shareabout 0.9129about 109.54219.09 DAI
Same tokens held in a wallet1100220 DAI

The pool sold ETH into a rising price and took DAI in exchange. The LP's 1% is now worth 219.09 DAI at the new price, against 220 DAI for someone who never deposited. The docs put the gap at a 0.91 DAI shortfall versus holding. This is the number most explainers skip: the formula itself sells your winners for you, a little at every step of the move.

That gap is what traders call impermanent loss. It shrinks if the price comes back and becomes permanent if you withdraw at the new price. The figure above ignores fees, which is the other half of the trade.

Where swap fees go in a crypto liquidity pool

Fees are taken from the trader's input and left in the pool, so they raise the reserves that every LP owns a slice of. In Uniswap v2 every pool charges a flat 0.30% fee that is added straight to the reserves (as of October 2026).

Because the fee stays in the pool, it lifts k itself. The Uniswap docs note that in v2 fees compound automatically by increasing k: your share of a larger invariant is worth more tokens when you withdraw, with no claim step. Balancer works the same way at the input, collecting swap fees from the input token before the invariant math runs.

Concentrated liquidity designs break that habit. PancakeSwap v3 lets one pair trade at fee tiers of 0.01%, 0.05%, 0.25% and 1% (as of October 2026), and its FAQ states plainly that v3 LP fees are not auto-compounded. You collect them and redeploy them yourself.

The protocol fee now takes a cut of the 0.30%

Uniswap v2 LPs no longer keep the whole swap fee. Following the December 2025 UNIfication governance proposal, protocol fees are active on all v2 pools, and the docs say the protocol share was set to approximately 1/6 of the swap fee at launch (as of October 2026, and governance can change it).

Run the arithmetic: one sixth of 0.30% is about 0.05 percentage points, which leaves roughly 0.25% of each swap for LPs. On the worked example, that is the rate the fee income has to beat the 0.91 DAI shortfall at. A pool only pays an LP once accumulated fees on their share exceed the drift against holding, and the protocol cut makes that hurdle a bit taller than most guides still assume.

Why an LP's share changes value as traders move the price

An LP owns a fixed fraction of the pool, not a fixed number of tokens. Every swap changes the mix of tokens behind that fraction, so its value tracks the pool's rebalanced reserves rather than the coins you deposited.

In the example the LP's fraction never changed: it was 1% before and after. What changed was what 1% contains. It went in as 1 ETH and 100 DAI and came out as about 0.9129 ETH and 109.54 DAI. The fee side adds to both reserves over time, which raises the value of that same 1%. The net result for an LP is fee growth minus rebalancing drift, and only the first part is under the trader's control through the choice of pool and fee tier.

If you want the version of this math where the two tokens are meant to hold the same price, the stablecoins liquidity pool mechanics guide covers StableSwap curves and what happens in a depeg.

Pool questions

What is liquidity pool crypto?

It is a smart contract holding two tokens that anyone can swap against. A formula, not an order book, sets the price from the ratio of the reserves, and the people who deposited those reserves share the swap fees in proportion to their stake.

Do liquidity pools make money?

They can earn fees, but fees are only one side of the ledger. In Uniswap v2 the LP share of the 0.30% fee now sits near 0.25% after the protocol cut, and that income has to outrun the shortfall versus holding that appears whenever the price moves.

What is impermanent loss in liquidity pools?

It is the gap between what your pool share is worth and what the same tokens would be worth held in a wallet. In the Uniswap docs example, a move from 100 to 120 DAI per ETH leaves the LP 0.91 DAI behind holding, before fees.

How risky are liquidity pools?

The mechanical risk is that the pool sells the token that is rising and buys the one that is falling, so a large one-way price move widens the gap versus holding. Fee terms also change: Uniswap governance switched on a protocol fee for every v2 pool, which trims what LPs keep.

More from PolyCasino

204 pulses by PolyCasino Chain Pulse

Up next

pulses that share a track with this one