Amber Node Chronicle

DeFi

How Liquidity Pools Price a Token Swap

A pool uses its own pricing rules and available liquidity to quote an exchange between tokens.

The pool has a current state

In a simple constant-product example, the reserves of two assets describe the starting point for a swap. As the swap uses one asset and adds the other, the pool state changes. Real protocols can use different curves, concentrated ranges or routing through multiple pools.

Price impact and slippage

Price impact concerns how the proposed trade changes the price offered by the available liquidity. Slippage concerns the difference between an earlier quote and execution. Market moves and changes to the pool can affect what arrives after the quote was shown.

What to compare in a quote

Look at the estimated output, the route and which costs are included. An interface can show a nominal swap fee while network execution charges are represented separately. Units and timestamps matter when comparing different screens.

Sources