๐Ÿ’ฐFINANCIAL GAMES๐Ÿ’ฐ

Learn finance through play!

SELECT TYPE

VISUAL REPRESENTATION

AUTOMATED MARKET MAKER (AMM)LIQUIDITY POOLETH10 tokens+USDC30,000 tokensFORMULA: x * y = k10 * 30,000 = 300,000(k must stay constant)TRADE: Send USDC โ†’ Get ETHPrice calculated automatically!NO ORDER BOOK โ€ข AUTOMATIC PRICING โ€ข 24/7 TRADING

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

1

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.

2

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).

3

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.

4

Price Impact

Larger trades change the pool ratio more, resulting in worse prices (slippage). Smaller trades have less impact and better prices.

5

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:

x * y = k

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

Feature
Traditional Market Maker
Automated Market Maker (AMM)
Order Book
Uses order book
No order book needed
Pricing
Set by buyers/sellers
Automatic (formula-based)
Liquidity
Professional market makers
Anyone can provide liquidity
Execution
Matches orders
Instant (smart contract)
Access
Requires exchange account
Permissionless (DeFi)
Slippage
Depends on order book depth
Depends on pool size
Fees
Exchange fees
Pool fees (to LPs)
24/7 Trading
Market hours
Always available

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.