A concrete example
A lending reserve and an exchange pool can both hold tokens but use different rules.
In context
Trades change reserve ratios and therefore the marginal price. A large trade relative to the pool moves that price substantially. Slippage tolerance limits the execution deterioration a user accepts; it does not promise that the displayed quote will be achieved. Arbitrage links pool prices to external markets through trading incentives.
The related mechanism, visually
- 01Initial reserves 100 / 100
- 02Add 10 X
- 03New reserves 110 / 90.91
- 04Receive about 9.09 Y
Read these as connected concepts, not necessarily consecutive steps.
Read the explanation
An automated market maker quotes trades using a reserve relationship rather than matching every order with another user’s limit order. In a simple constant-product model, x × y stays constant before fees as one reserve grows and the other shrinks. The marginal price changes during a trade, so the average execution price differs from the initial marginal price.
Put the mechanism into context
A fee-free pool holds 100 X and 100 Y. Add 10 X in a swap. Keep the product at 10,000 and calculate the new Y reserve and the amount of Y received. Compare with a naive expectation of 10 Y.
Apply it in the workshop →What this mechanism does not guarantee
Price impact comes from the trade’s size relative to liquidity; slippage also reflects changes between quote and execution. A minimum-output condition can bound an accepted result but may cause a revert. Concentrated-liquidity and stable-swap designs use different mechanics, so this example should not be applied unchanged to every pool.
Explore the full explanation
Liquidity pools and automated market makers
A liquidity pool holds assets under contract rules so users can exchange or borrow them.