QBMFX Academy

Automated Market Makers and Liquidity Pools

By QBMFX Academy · Updated · Editorial standards

An automated market maker, or AMM, uses contract rules to exchange assets against liquidity pools. In a simple constant-product pool, reserves follow x×y=k before considering fees and implementation details.

How it works

For a fee-free two-asset constant-product illustration, adding one asset and removing the other changes the reserve ratio and marginal price. Large trades move the ratio more than small trades. Arbitrage tends to connect pool pricing with outside markets but relies on transaction incentives and execution. Other designs, including concentrated liquidity, follow additional rules.

Worked example

A pool holds 100 token X and 10,000 units of Y, so k=1,000,000. Adding 10 X gives a new X reserve of 110. To preserve k, Y reserve becomes about 9,090.91, so the trader receives about 909.09 Y before fees. Average execution is 90.91 Y per X, below the starting marginal ratio of 100 because the trade moves price.

Amounts, prices and scenarios are fictional teaching examples. They exclude any effects not explicitly stated and are not trade recommendations.

Limits and common mistakes

Fees, rounding, transfer-tax tokens, slippage limits and transaction ordering affect actual results. Liquidity-provider tokens are claims under contract rules, not guaranteed bank deposits. A copied interface or high advertised yield does not establish contract identity or safety.

Knowledge check

Why is the whole trade not filled at the starting reserve ratio?

Read the explanation

The reserve ratio changes as the trade moves along the curve. The average price reflects the entire change in reserves.

References and further reading

These sources explain the underlying concepts and specifications. They do not endorse QBMFX Academy. Check the relevant market, protocol version and reporting rules before applying an example.