DeFi

Automated market maker (AMM)

Also called: AMM · constant product market maker

Definition

An automated market maker (AMM) is a type of DEX that prices trades with a mathematical formula based on the tokens held in a liquidity pool, instead of matching buyers and sellers in an order book.

This entry is shown in English.

How Automated market maker works

The best-known formula is the constant product, x times y equals k, used by Uniswap v2. A pool holds two tokens. When you buy one, you add the other, and the formula moves the price so that the product of the two balances stays the same, before fees.

Liquidity providers deposit both tokens and earn the trading fee. Bigger pools mean smaller price moves for the same trade, which is why large trades in shallow pools suffer heavy price impact.

Newer designs adjust the model. Curve uses curves suited to assets that should trade near the same price, such as stablecoins. Uniswap v3 and later let providers concentrate liquidity in a price range, which makes pools deeper near the current price but requires more active management.

Example

Suppose a pool holds 100 ETH and 300,000 USDC, so k is 30,000,000 and the price is 3,000 USDC per ETH. You buy ETH with 30,000 USDC, ignoring fees. The pool now has 330,000 USDC, so ETH must fall to 30,000,000 divided by 330,000, about 90.91 ETH. You receive about 9.09 ETH, an average price of roughly 3,300 USDC. That 10 percent gap is the price impact of a large trade in a small pool.

Common mistakes

  • Expecting the quoted spot price for a large trade in a small pool.
  • Thinking AMM liquidity providers only earn fees and never lose relative to holding.
  • Ignoring which AMM design a pool uses when comparing fees and depth.

Learn and practise

FAQ

How does an AMM set prices?

By the ratio of tokens in the pool, adjusted through a formula. Arbitrage traders keep the pool price close to prices on other markets.

Is Uniswap an AMM?

Yes. Uniswap is one of the largest AMM-based decentralized exchanges.