AMM
Share post
In Brief
An AMM (Automated Market Maker) is the algorithm behind decentralized exchanges that prices and settles trades against a liquidity pool using a mathematical formula, instead of matching buyers and sellers through a traditional order book.

What Is an AMM (Automated Market Maker)?
An Automated Market Maker (AMM) is the technology that powers most decentralized exchanges (DEXs). Instead of matching individual buyers and sellers through an order book, an AMM uses a mathematical formula and a pool of tokens to set prices and execute trades automatically.
This innovation made permissionless, always-available token swapping possible — anyone can trade at any time, and anyone can supply liquidity to earn fees. Uniswap popularized the model, and it now underpins much of DeFi.
How Does an AMM Work?
Liquidity providers deposit a pair of tokens into a liquidity pool.
The AMM uses a formula to determine the price based on the ratio of tokens in the pool.
When a trader swaps, they add one token to the pool and remove the other.
Each trade shifts the ratio, automatically adjusting the price for the next trade.
A small fee on each swap is paid to the liquidity providers.
The Constant Product Formula
Many AMMs use the constant product formula: x * y = k, where x and y are the quantities of the two tokens and k is a constant.
As you buy more of one token, its quantity falls and its price rises.
This ensures the pool can never be fully drained and always quotes a price.
It also explains why large trades cause more slippage.
AMM vs Order Book Exchange
| Feature | AMM (DEX) | Order Book (CEX) |
|---|---|---|
| Price set by | Formula + pool ratio | Matching buy/sell orders |
| Counterparty | A liquidity pool | Another trader |
| Availability | Always on | Needs active orders |
| Who provides liquidity | Anyone (LPs) | Market makers |
| Custody | Non-custodial | Often custodial |
Popular AMM Models
Constant product (x*y=k) — general-purpose pools (e.g. Uniswap v2).
Stablecoin AMMs — optimized for low-slippage swaps between similar-value assets (e.g. Curve).
Concentrated liquidity — lets LPs focus capital in specific price ranges (e.g. Uniswap v3).
AMMs and Trust Wallet
Trust Wallet connects you to AMM-powered DEXs through its in-app dApp browser and WalletConnect, letting you swap and provide liquidity across 100+ blockchains. Because Trust Wallet is non-custodial, you trade directly from your own wallet and keep full control of your private keys — no central exchange holds your funds.