Understanding Automated Market Makers: How DEX Trading Works
Dive deep into automated market makers, the engine behind decentralized exchanges, and learn how liquidity pools enable trustless trading.
What Are Automated Market Makers?
Automated Market Makers (AMMs) use mathematical formulas to price assets instead of order books. They allow digital assets to be traded automatically using liquidity pools rather than matching individual buyers and sellers.
The Constant Product Formula
The most common AMM model uses x * y = k, where x and y are token quantities and k is constant. When a trader swaps Token A for Token B, they change the ratio, and the price adjusts automatically.
Liquidity Providers
Liquidity providers (LPs) deposit tokens into pools and earn trading fees — typically 0.3% per swap. In return, they accept the risk of impermanent loss when token prices diverge.
Concentrated Liquidity
Uniswap V3 introduced concentrated liquidity, allowing LPs to allocate capital within specific price ranges. This dramatically improves capital efficiency, as LPs earn more fees with less capital.
Different AMM Models
- Constant Product (Uniswap): General-purpose, works for all token pairs
- StableSwap (Curve): Optimized for similarly-priced assets like stablecoins
- Weighted Pools (Balancer): Custom weight ratios enabling index-fund structures
Slippage and Price Impact
Large trades relative to pool liquidity cause price impact. Cross-chain aggregators like Alkizen help find the best prices by routing across multiple pools and chains, minimizing slippage for users.