Jump to content
Crypto Desk Report

Crypto markets, protocols and policy

LP token minting: how pools price a deposit

How are LP tokens minted when you add liquidity to a pool? The pool compares your deposit with its reserves and mints shares in proportion to the smaller ratio.

Crypto Desk Report Editorial#60a14b4 min read

LP token minting: how pools price a deposit

A liquidity pool mints LP tokens to give a depositor a proportional claim on its reserves: after the first deposit, it multiplies the existing supply by the smaller of the deposit-to-reserve ratios. That keeps new shares in line with the value added, so existing holders are not diluted.

Existing pools mint shares from the smaller reserve ratio

For a two-token constant-product pool, let the reserves be X and Y, the deposit be dx and dy, and the current LP token supply be S. The mint is S × min(dx/X, dy/Y). Each deposit amount is measured against its matching reserve, then the pool uses the smaller ratio to set the new share amount.

Say a pool holds 100 ETH and 300,000 USDC, with 5,000 LP tokens outstanding. A deposit of 1 ETH and 3,000 USDC is 1% of each reserve, so the pool mints 50 LP tokens. The depositor owns 50 of the new 5,050-token supply, or just under 1% of the pool, matching the proportion of reserves added.

The minimum matters when the deposit is off the pool’s current ratio. If the same depositor adds 1 ETH and 4,000 USDC, the ratios are 1% and about 1.33%. The pool mints against the 1% ETH side. The extra USDC may be refunded by the router or handled as a swap, depending on how the liquidity transaction is routed.

SyncSwap’s Classic Pool is a concrete case for comparing fee growth with the reserves used in this calculation. When trades leave fees in the pool, those fees add to reserves while LP token supply stays flat; see how syncswap fees fit into that reserve-based pricing. A later depositor is priced against the larger reserves, so the same dollar value of tokens generally represents a smaller share and mints fewer LP tokens. Newcomers join at the pool’s current value, rather than receiving a claim on fees earned before they arrived.

The first deposit sets the initial share supply

An empty pool has no existing supply or reserves to use in the later-deposit formula. In the Uniswap v2 model, the first mint instead takes the square root of the two deposit amounts multiplied together, then subtracts 1,000 LP token units: sqrt(x × y) − 1000. The contract permanently locks those 1,000 units as MINIMUM_LIQUIDITY.

That locked amount prevents the first provider from later removing every last share and returning the pool to a completely empty state. It also raises the cost of share-inflation attacks against an empty pool: a tiny initial deposit cannot create a freely redeemable supply of shares that an attacker can then distort. The first provider gets the calculated amount minus the lock; subsequent providers use the proportional reserve formula instead.

For an existing pool, the calculation follows a short sequence:

  • Read the reserves: X and Y show how much of each token the pool currently holds.
  • Measure the deposit: dx/X and dy/Y show each token’s contribution relative to its reserve.
  • Apply the smaller ratio: multiplying that ratio by total LP supply gives the new LP tokens.

In practice, the displayed estimate can depend on the reserves and supply at the moment the transaction executes. Trades and accrued fees can change reserves between a quote and confirmation, while integer rounding can affect the final token amount. The formula gives the expected mint from the balances and supply used by the pool’s mint logic.

Stable pools use a different measure because their pricing curve is designed for assets that trade near parity. Rather than relying on a plain reserve ratio, a stableswap-style pool calculates how much the deposit grows its invariant D and mints LP tokens in proportion to that growth. SyncSwap’s Stable Pool uses this invariant-based approach, so its estimate follows D rather than the Classic Pool reserve-ratio calculation.

Related

What happens to LP tokens when liquidity is removed?

When a provider removes liquidity, the pool burns LP tokens and returns the provider’s proportional claim on the reserves. The claim can include value from fees that accumulated while those tokens were held, because fees increased the reserves behind each share.

Why does the first liquidity provider set the pool price?

The first provider chooses the initial amounts of both tokens, and their ratio establishes the starting exchange rate in a constant-product pool. Later deposits are measured against that existing ratio; a deposit at a different ratio must account for the smaller side or route the excess through a swap.