Automated Market Maker (AMM)

An Automated Market Maker (AMM) is a smart contract that lets people trade tokens against a shared liquidity pool, with prices set by a mathematical formula instead of an order book matching buyers and sellers.

An AMM holds reserves of two tokens, such as ETH and USDC, deposited by liquidity providers. Traders swap directly with this pool, and a formula prices each token relative to the other based on how much of each the pool holds. The best-known design, the constant product market maker popularised by Uniswap, keeps the product of the two reserves constant: x × y = k.

Take a hypothetical pool holding 10 ETH and 20,000 USDC, so k is 200,000 and the implied price is 2,000 USDC per ETH. To take 1 ETH out, the pool must end with 9 ETH and about 22,222 USDC to keep k unchanged. The trader therefore pays roughly 2,222 USDC before fees. The larger a trade is relative to the pool, the further the price moves against the trader. This effect is called slippage.

AMMs matter because they make trading permissionless and always available. Anyone can swap tokens or supply liquidity without a broker or a matching counterparty, and liquidity providers earn a share of the trading fees.

A common misconception is that an AMM knows the market price. It only knows its own reserves. Arbitrageurs keep its price in line with other markets by trading whenever the two drift apart. Liquidity providers face impermanent loss when prices move, and traders can lose value to slippage and sandwich attacks.

Learn more

Related terms