AUTOMATED MARKET MAKERS (AMM)
Automated Market Makers: Trading Without Order Books
Automated Market Makers (AMMs) use smart contracts and liquidity pools to automatically facilitate trades. No order book needed - prices are determined by mathematical formulas.
SELECT TYPE
VISUAL REPRESENTATION
WHAT IS AN AUTOMATED MARKET MAKER?
An Automated Market Maker (AMM) is a smart contract that automatically facilitates trades using liquidity pools instead of an order book. Prices are determined by mathematical formulas, not by matching buy and sell orders.
Think of it like a vending machine: you put in one token, and the machine automatically gives you the other token based on a fixed formula. No need to find someone who wants to trade with you.
HOW AUTOMATED MARKET MAKERS WORK
Liquidity Pool Creation
Users (liquidity providers) deposit pairs of tokens into a smart contract. For example, 1 ETH and 3,000 USDC go into a pool.
Constant Product Formula
The AMM uses a formula like x * y = k (constant product). The product of the two token amounts must always equal a constant (k).
Automatic Pricing
When someone wants to buy ETH, they send USDC to the pool. The formula automatically calculates how much ETH they get based on the current pool ratio.
Price Impact
Larger trades change the pool ratio more, resulting in worse prices (slippage). Smaller trades have less impact and better prices.
Liquidity Provider Rewards
Liquidity providers earn fees (usually 0.3% per trade) from all trades in the pool. They receive LP tokens representing their share of the pool.
THE CONSTANT PRODUCT FORMULA
The most common AMM formula is the constant product formula:
Where:
- x = Amount of token A in the pool
- y = Amount of token B in the pool
- k = Constant (must always stay the same)
Example:
Pool has: 10 ETH and 30,000 USDC
k = 10 * 30,000 = 300,000
If someone buys 1 ETH:
New pool: 9 ETH and ? USDC
9 * ? = 300,000
? = 33,333 USDC
Buyer pays: 33,333 - 30,000 = 3,333 USDC for 1 ETH
Price: 3,333 USDC per ETH (higher than initial 3,000 due to slippage)
POPULAR AMM EXAMPLES
Uniswap
The most popular AMM on Ethereum. Uses constant product formula (x * y = k).
Features:
- No order book
- Liquidity pools
- Automated pricing
- Anyone can provide liquidity
PancakeSwap
AMM on Binance Smart Chain. Similar to Uniswap but on BSC network.
Features:
- Lower fees
- Faster transactions
- Yield farming
- Lottery features
Raydium
AMM on Solana. Integrates with Serum order book for hybrid model.
Features:
- Very fast
- Low fees
- Order book integration
- High throughput
AMM vs TRADITIONAL MARKET MAKER
LIQUIDITY PROVIDERS (LPs)
Liquidity Providers are users who deposit tokens into AMM pools. They earn fees from all trades in the pool.
1. Deposit Tokens
LP deposits equal value of both tokens (e.g., $1,000 ETH + $1,000 USDC)
2. Receive LP Tokens
LP receives tokens representing their share of the pool (e.g., "UNI-V2-LP")
3. Earn Trading Fees
Every trade in the pool pays a fee (usually 0.3%), which goes to LPs
4. Withdraw Anytime
LP can burn their LP tokens to withdraw their share of the pool (plus fees earned)
โ ๏ธ Impermanent Loss Risk
If token prices change significantly, LPs may get back less value than if they had just held the tokens. This is called "impermanent loss" (permanent if prices don't return).
BENEFITS & LIMITATIONS
โ Benefits of AMMs
- No order book needed - always available to trade
- Permissionless - anyone can trade or provide liquidity
- 24/7 trading - never closes
- Automated pricing - no manual market making
- Lower barriers - no need to be a professional trader
- Transparent - all on blockchain
- Composable - can integrate with other DeFi protocols
โ Limitations of AMMs
- Slippage on large trades (price impact)
- Impermanent loss for liquidity providers
- Gas fees on Ethereum (can be expensive)
- Less efficient for very liquid pairs
- Front-running possible (MEV attacks)
- Smart contract risk (bugs, hacks)
- Price discovery less efficient than order books
USE CASES FOR AMMs
๐ Token Swaps
Swap any ERC-20 token for another instantly without finding a counterparty.
๐ฐ Yield Farming
Provide liquidity to earn trading fees and sometimes additional token rewards.
๐ฆ DeFi Integration
AMMs are building blocks for lending, borrowing, and other DeFi protocols.
๐ Cross-Chain Bridges
AMMs enable swapping tokens across different blockchains.
๐ Price Discovery
AMMs help discover prices for new tokens that don't have established markets.
๐ฏ Arbitrage
Traders can profit from price differences between AMMs and other exchanges.
KEY TAKEAWAYS
๐ค Automation is Key
AMMs automate market making using smart contracts and mathematical formulas. No human market makers needed.
๐ง Liquidity Pools Replace Order Books
Instead of matching buy and sell orders, AMMs use pools of tokens that anyone can trade against.
๐ Formula-Based Pricing
Prices are determined automatically by formulas (like x * y = k), ensuring the pool always has liquidity.
๐ฅ Anyone Can Participate
Unlike traditional markets, anyone can provide liquidity to AMMs and earn fees, not just professional traders.
โก Always Available
AMMs run 24/7 on blockchains, never closing. You can trade anytime, anywhere.
โ ๏ธ Understand the Risks
While AMMs are powerful, understand slippage, impermanent loss, and smart contract risks before participating.