Automated Market Maker (AMM)

A DeFi exchange model that uses smart contracts and algorithms to price trades via liquidity pools instead of order books.

An automated market maker (AMM) is a decentralized exchange mechanism that uses smart contracts and mathematical formulas to quote prices and execute trades without relying on a traditional order book. Instead of matching buyers and sellers directly, AMMs let users swap tokens against a shared pool of assets on-chain.

How AMMs replace order books with liquidity pools

In an order book exchange, prices come from limit orders placed by traders. In an AMM, pricing is determined by an algorithm based on the ratio of tokens in a liquidity pool. A common design, used by early versions of Uniswap, applies a constant product formula where the pool’s balances must satisfy a relationship such as x · y = k. When someone buys one asset from the pool, its balance decreases, the other asset’s balance increases, and the quoted price shifts automatically. This is why large trades can move the execution price noticeably, a phenomenon known as slippage.

Liquidity providers, fees, and key risks

Liquidity pools are funded by liquidity providers (LPs), who deposit two or more assets into a smart contract so others can trade. In return, LPs typically earn a share of swap fees and, in some designs, additional protocol incentives. For example, a trader swapping ETH for a stablecoin on a DEX pays a fee that is distributed to LPs.
AMMs introduce unique risks. LPs can experience impermanent loss when the relative price of pooled assets changes compared with simply holding them. Traders and LPs also face smart contract risk, plus the possibility of value extraction by sophisticated actors who reorder or sandwich transactions.
AMMs matter because they enable permissionless, always-on liquidity for tokens globally, powering much of DeFi trading, pricing, and composable on-chain finance.