Automated Market Maker
- Category
- Decentralised Finance
- Level
- Professional
Simple definition
A pool of two assets that quotes its own prices by a fixed rule instead of matching buyers with sellers. You trade against the pool, and every trade changes the price it offers next.
Professional definition
A pricing contract that always stands ready to trade, setting its quote from the ratio of its reserves. In the constant-product design the product of the two reserves is held fixed by every swap, so price moves along a curve; liquidity providers deposit both assets and earn a fee on each trade.
Technical definition
An invariant-based market maker. The invariant fixes the feasible set of reserve pairs, and the marginal price is the slope of that curve at the current point, which makes price impact a deterministic function of trade size relative to depth. Because the pool quotes without reference to external markets, keeping it aligned is the job of arbitrageurs, and the value they extract is paid by liquidity providers as divergence loss. Other designs vary the invariant: constant sum, hybrid stable curves and concentrated-liquidity ranges all change the impact profile.
Academic definition
A market-making mechanism in which quotes are determined algorithmically by a conservation condition over pooled reserves, replacing discretionary quoting and order matching with a deterministic pricing function.
Mechanism
The invariant guarantees that someone is always willing to trade, and it pays for that guarantee with price impact: buying scarce side pushes the quote up the curve, which both charges the taker and protects the pool from being drained. Arbitrage drags the pool back to the wider market. Liquidity providers are therefore short volatility and long trading activity, and the balance of fees against divergence decides the result.
In practice
- Who uses it
- On-chain traders sizing swaps, liquidity providers, protocol designers, and arbitrage desks.
- Why it matters
- It makes a market possible for assets no professional market maker would quote, with depth and impact both readable from public state.
- Limitations
- Price impact grows with size relative to depth, the pool follows external prices only as fast as arbitrage can act, and fee income is not a return until it exceeds divergence loss and gas.
Common mistakes
- Reading the pool's quote as the price for any order size.
- Providing liquidity to a volatile pair expecting fee income alone.
- Applying constant-product intuition to stable or concentrated-liquidity pools.
Examples
A pool holds 20,000 of a stable asset and 10 ETH, so the quote is 2,000 per ETH. A 1,000 buy at a 0.30% fee returns about 0.4748 ETH — an effective 2,106 per ETH, roughly 5.3% above the quote, because the trade moved along the curve.
- Reserves: x = 20,000 stable units, y = 10 ETH
- Fee f = 0.30%
- Trade size = 1,000 stable units
- Constant-product pool
- Spot quote = 20,000 / 10 = 2,000 per ETH
- Input after fee = 1,000 x 0.997 = 997
- ETH out = 10 x 997 / (20,000 + 997) = 9,970 / 20,997 = 0.4748
- Effective price = 1,000 / 0.4748 = 2,106
Impact scales with trade size relative to reserves. The same 1,000 order in a pool ten times deeper would cost a fraction of this.
A new token lists with a shallow pool. The quoted price looks firm, but a single order a tenth the size of the reserves moves it by double digits — the quote described the pool, not a market.
Mathematical foundation
Variables
| x | Reserve of the asset being paid in | asset units |
| y | Reserve of the asset being bought | asset units |
| k | The invariant: the product of the two reserves, unchanged by a swap | product of units |
| P | Marginal (quoted) price of x in terms of y | ratio |
| f | Swap fee rate retained by the pool | fraction |
| \Delta x | Amount paid in | asset units |
| \Delta y | Amount received | asset units |
Procedure
Read the two reserves from the pool. Divide them to get the quoted price. For a trade, subtract the fee from the input, then compute the output that keeps the product of reserves unchanged; the output formula above is that condition rearranged. Divide input by output to get the effective price, and compare it with the quote to read the impact.
Worked example
- x = 20,000 stable units
- y = 10 ETH
- f = 0.003
- Delta x = 1,000
- P = 20,000 / 10 = 2,000
- Delta x (1-f) = 1,000 x 0.997 = 997
- Delta y = 10 x 997 / (20,000 + 997) = 9,970 / 20,997
- Delta y = 0.47483 ETH
- Effective price = 1,000 / 0.47483 = 2,106
Interpretation
The quote is only the price of an infinitesimal trade. Any real order pays more, and the excess is set by its size relative to the reserves, which is why depth matters more than the displayed price.
Assumptions
- The formulas given are those of the constant-product design. Constant-sum, hybrid stable and concentrated-liquidity pools use different invariants and produce different impact, so these equations must not be applied to them.
- The fee is taken from the input before the invariant is applied, which is the common implementation; some designs charge differently and the output changes accordingly.
- A single pool and no routing across pools. Reserves are assumed not to change between quote and execution, which fails under congestion or front-running.
- The invariant describes execution, not value: it says what a trade costs, never whether the price is right.
- Gas, routing and multi-hop paths are excluded, so the effective price computed here is a floor on the real cost.
Related terminology
- related
- Impermanent Loss Centralised Exchange versus Decentralised Exchange Decentralised Finance Liquidity Slippage Market Making Arbitrage Yield Farming Order Book
Order Book
An order book holds prices other participants chose. An AMM computes its price from reserves, with no quotes behind it.
Sources
BIS Quarterly Review · 2021-12 · discussion of decentralised exchanges and liquidity pools
https://www.bis.org/publ/qtrpdf/r_qt2112b.pdf URL verified
BIS · sections on DeFi market structure and liquidity provision
https://www.bis.org/publ/othp72.pdf URL verified
IOSCO · description of DeFi trading arrangements and their operators
https://www.iosco.org/library/pubdocs/pdf/ioscopd754.pdf URL verified
Editorial status
Flagged by the editor as uncertain on a linguistic, mathematical or regulatory point.
