Rule Craft

Learn · 4 min read

What is an automated market maker?

How a pool of two tokens can quote a price without an order book.

An automated market maker, or AMM, is a contract that holds two tokens and trades them against anyone who asks. There is no order book and no counterparty waiting on the other side. The price comes from the pool's own balances.

Constant product

The simplest design keeps the product of the two balances constant. Buy token B with token A and the pool's A balance goes up, its B balance goes down, and B gets more expensive. A large trade moves the price more than a small one; that movement is called price impact.

x * y = k

Concentrated liquidity

Later designs let liquidity providers choose a price range. Inside that range their capital works much harder, so the same money gives deeper prices. Outside it, it earns nothing.

Where hooks come in

Uniswap v4 keeps concentrated liquidity and puts every pool in a single contract. It also lets each pool attach a hook: a contract that runs at fixed points of the pool's life. That is what makes rules like fees that change with size or burns on buys possible without a new AMM.