Automated Market Maker

An automated market maker (AMM) is a smart contract that holds pools of two or more tokens and quotes prices for trades against those pools using a fixed mathematical formula instead of matching buyers and sellers in an order book.

Share
Automated Market Maker

An automated market maker (AMM) is a smart contract that holds pools of two or more tokens and quotes prices for trades against those pools using a fixed mathematical formula instead of matching buyers and sellers in an order book. In traditional finance, a market maker is a firm that quotes bids and offers. An AMM performs the same role through code, with capital supplied by outside liquidity providers (LPs).

How it works

LPs deposit token pairs into a pool and receive a claim on its reserves plus a share of trading fees. Traders swap directly against the pool, and the price moves according to the pool's invariant. Uniswap v2 popularized the constant product formula, x × y = k, with a 0.30% fee per swap. Example: a pool holds 10 ETH and 10,000 USDC, so k = 100,000. A trader removing 1 ETH leaves 9 ETH, so USDC reserves must rise to 100,000 / 9 = 11,111.11. The trader pays about 1,111 USDC before fees, above the 1,000 USDC starting spot price. That gap is price impact, and it grows with trade size relative to pool depth.

Other designs change the formula or how capital is placed. Curve's StableSwap invariant flattens the curve near a 1:1 price, which reduces slippage between assets meant to trade at par, such as USDC and USDT. Uniswap v3 introduced concentrated liquidity, letting each LP supply capital only within a chosen price range. Balancer generalizes the constant product to pools of up to eight tokens with custom weights. Prices on all of these move only when someone trades, so arbitrageurs keep them aligned with prices on other venues.

Why it matters

AMMs provide continuous onchain liquidity without a central operator, and they handle a large share of decentralized exchange volume on Ethereum and other chains. Their reserves and swaps are public, so liquidity depth, fee revenue and execution quality can be measured directly from chain data. The principal risks are structural. LPs face impermanent loss, the shortfall versus simply holding the tokens when prices diverge, because arbitrageurs trade against stale pool prices. Public mempools expose traders to sandwich attacks and other forms of MEV. Thin pools can also be manipulated when other protocols read an AMM's spot price as an oracle.

Frequently asked questions

Who sets the price in an automated market maker?

The pool's formula sets the price based on current reserves. Arbitrageurs move it toward prices on other venues by trading whenever the pool is out of line.

How do liquidity providers earn money in an AMM?

LPs earn a share of swap fees, such as 0.30% per trade in Uniswap v2 pools. Those fees may or may not exceed losses from impermanent loss.

Is an AMM the same as a decentralized exchange?

No. A decentralized exchange is the venue. An AMM is one pricing mechanism a DEX can use. Some DEXs, such as dYdX, use onchain or hybrid order books instead.


See the data behind this post. Browse the decoded DEX trade tables, or read Top DEXs by Volume for how the records are put together.


Allium provides onchain data infrastructure. Companies named in this article may be Allium customers, prospects or commercial counterparties. The authors and other Allium personnel may hold positions in the assets discussed. This article is informational only and is not investment, legal or tax advice. Data and information last reviewed: November 27, 2026.