
A traditional exchange keeps an order book: buyers state the price they will pay, sellers state the price they will accept, and the exchange matches them. Many decentralised exchanges use a different machine called an automated market maker, or AMM.
An AMM stores two assets in a smart contract called a liquidity pool. Imagine a pool containing ether and a stablecoin. A trader who wants ether adds stablecoins to the pool and removes some ether. The contract calculates the amount using a mathematical rule instead of waiting for a specific seller.
A common simplified rule is x multiplied by y equals k. Here x and y are the quantities of the two assets, while k should remain roughly constant after a trade, before fees. When ether becomes scarcer in the pool, the formula makes each additional unit more expensive. The pool’s ratio therefore moves as people trade.
The displayed price is not an opinion formed by the contract. It emerges from the current reserves. If the AMM price differs from larger markets, arbitrage traders buy from the cheaper place and sell to the expensive one. Their transactions push the pool back toward the wider market price.
Large trades move the reserve ratio more than small trades. The difference between the expected price and the executed price is called slippage. Deep pools usually produce lower slippage, while a thin pool can move dramatically from a modest transaction. Slippage limits protect users from accepting a much worse result than expected.
AMMs make always-available on-chain trading possible, but their contracts, tokens, and pools still carry risk. A fake token can use a familiar symbol, a pool can be too shallow to exit safely, and a poorly chosen slippage setting can invite manipulation or failed transactions.
The pool clearly needs assets before anyone can trade. Tomorrow we will meet the liquidity providers who deposit those assets, collect fees, and take on a less obvious risk called impermanent loss.