Blockchain Basicsintermediatearticle30 min read

Automated Market Makers: A Comprehensive Guide for Beginners | VCC

**Automated market makers** (AMMs) have completely changed how we trade digital assets. If you've ever used Uniswap, PancakeSwap, or KyberSwap, you've interacted with an AMM — possibly without knowing it. This article explains **automated market makers** in plain language, from core concepts to real...

Vietcardano teamTeam

Đội ngũ biên tập VietCardanoCommunity — các chuyên gia blockchain và Cardano, cung cấp nội dung giáo dục và nghiên cứu chuyên sâu cho cộng đồng.

Published September 14, 2026
Mục lục (47 mục)

Automated market makers (AMMs) have completely changed how we trade digital assets. If you've ever used Uniswap, PancakeSwap, or KyberSwap, you've interacted with an AMM — possibly without knowing it. This article explains automated market makers in plain language, from core concepts to real-world risks, with special context for users in Vietnam and emerging markets.


What Are Automated Market Makers? (And Why You Should Care)

Imagine you walk into a traditional market. You want to buy 1 kg of apples. You must find a seller, negotiate the price, and wait for the trade to settle. If nobody is selling, you can't buy. That's the order book model — used by centralized exchanges (CEXs) like Binance and Coinbase.

Now imagine a vending machine. The machine always has apples and cash. You insert money, and it calculates: "10 kg of apples left, 100,000 VND in the box → price is 10,000 VND/kg." You buy 1 kg, and the machine updates: "9 kg of apples left, 110,000 VND → price ~12,222 VND/kg." The price auto-adjusts based on inventory. No seller needed, no order matching required. That's an Automated Market Maker (AMM).

Automated market makers are DeFi protocols that use mathematical formulas instead of order books to price assets and execute trades. They replace traditional "market makers" with liquidity pools — asset reserves contributed by users, priced by code.

Quick summary: AMM = Asset pool + Auto-pricing formula + Anyone can trade instantly.

Why are AMMs important in DeFi?

1. Permissionless: Anyone can create a new trading pair, supply liquidity, or swap tokens — no KYC, no approval needed.

2. Always-on liquidity: Unlike order books (which can be empty on one side), AMMs always allow swaps as long as the pool has assets.

3. Open & transparent: Code is public, immutable, running on-chain. No "exchange outage" or manual price intervention.

4. Bootstrapping new projects: Vietnamese token projects (Kyber Network, Coin98, TomoChain) often launch on Uniswap/PancakeSwap first — near-zero cost compared to listing on a CEX.

Chart - Traditional Order Book vs AMM: order book matches buyers/sellers; AMM uses pool with formula


Evolution: From Bancor to Uniswap V3

EraMilestoneKey innovation
2017Bancor (V1)First AMM: "Smart Tokens" with continuous pricing formula
2018Uniswap V1Simplified: xy=k, ETH↔ERC20 only, 0.3% fee
2020Uniswap V2Direct ERC20↔ERC20 pairs, price oracle, flash swaps
2020Curve Finance (StableSwap)Formula optimized for stablecoins: near-zero slippage
2021Uniswap V3Concentrated Liquidity: LPs pick price ranges, capital efficiency up to 4000x
2022+Curve Crypto, Ambient, UniswapXDynamic peg, intent-based, solver auctions

Key insight: AMMs don't "perfect" at any single version. They evolve in a chain: Constant Product → StableSwap → Concentrated → Dynamic → Intent-based. Beginners should understand V2 (xy=k) first — it's the "atom" of every modern AMM.

Table - AMM Evolution: V1 (Bancor) → V2 (Uniswap) → StableSwap (Curve) → V3 (Concentrated) → Intent-based


How AMMs Work: From A to Z

1. Liquidity Pool — "Shared Asset Reserve"

Instead of matching buyers and sellers, AMMs pool assets into a smart contract called a pool. For example, a USDC/ETH pool:

  • Liquidity providers (LPs) deposit: 10,000 USDC + 5 ETH
  • Pool holds: reserve_USDC = 10,000, reserve_ETH = 5
  • LPs receive LP tokens — certificates representing their percentage ownership of the pool

2. Constant Product Formula (xy=k) — The Heart of AMMs

This is the constant product formula — the core formula of Uniswap V2 and most basic AMMs:

x  y = k

Where:

  • x = quantity of token A in the pool (e.g., USDC)
  • y = quantity of token B in the pool (e.g., ETH)
  • k = invariant constant (only changes when fees are added or LPs deposit/withdraw)

Real-number example:

  • Initial pool: 10,000 USDC × 5 ETH = 50,000 (k)
  • You swap 1,000 USDC → ETH
  • New pool: 11,000 USDC × y = 50,000 → y = 4.545 ETH
  • You receive: 5 - 4.545 = 0.455 ETH
  • Execution price: 1,000 USDC / 0.455 ETH ≈ 2,198 USDC/ETH
  • Spot price before swap: 10,000 / 5 = 2,000 USDC/ETH
  • Price impact: ~9.9% (due to large trade size relative to pool)

Diagram - How a swap works on an AMM: user sends token A, pool calculates result via x<em>y=k, returns token B

3. How Is Price Determined?

Spot price (current price) = reserve_B / reserve_A

In the example: 5 ETH / 10,000 USDC = 0.0005 ETH/USDC (or 2,000 USDC/ETH).

Price impact grows non-linearly with trade size:

  • Small trade (1% of pool): impact ~1%
  • Trade 10% of pool: impact ~11%
  • Trade 50% of pool: impact ~100%

This is why whales don't like constant-product AMMs — slippage is too high.

Chart - Constant product curve x</em>y=k showing price impact curve

4. Swap Fees & LP Distribution

  • Uniswap V2: 0.3% per swap
  • Fees don't go to the dev team — they're automatically added to k (added to the pool)
  • LPs earn fees proportional to their pool ownership percentage

Example: Pool has 10,000 USDC / 5 ETH. Swap 1,000 USDC → fee is 3 USDC. New pool: 11,003 USDC / 4.545 ETH. k rises from 50,000 → 50,145. LP pool value increases.


Impermanent Loss: The "Hidden Risk" for Liquidity Providers

This is the most important concept every new LP must understand.

What Is Impermanent Loss?

When you deposit tokens into a pool, you're selling volatility. If the token price changes compared to when you deposited, your LP position value will be LOWER than if you simply held the two tokens separately.

Impermanent Loss (IL) formula:
> IL = 2  √(price_ratio) / (1 + price_ratio) - 1
Where price_ratio = current_price / price_at_deposit

Numerical Example: What Does IL Look Like?

You deposit: 1 ETH + 2,000 USDC (price 1 ETH = 2,000 USDC). Total value: 4,000 USDC.

ScenarioETH PriceHold Value (1 ETH + 2,000 USDC)LP Position ValueImpermanent Loss
Price unchanged2,000 USDC4,000 USDC4,000 USDC0%
ETH 2x4,000 USDC6,000 USDC5,657 USDC-5.7%
ETH 5x10,000 USDC12,000 USDC8,944 USDC-25.5%
ETH /21,000 USDC3,000 USDC2,828 USDC-5.7%
ETH /5400 USDC2,400 USDC1,789 USDC-25.5%

Key observations:

  • IL is symmetric: price up or down both cause loss (vs. holding)
  • IL only becomes "permanent" when you withdraw liquidity
  • If price returns to the original level before withdrawal → IL = 0 (hence "impermanent" — temporary)

Can Swap Fees Offset IL?

Fee is 0.3%/swap. You need high volume to compensate.

  • Pool 10,000 USDC / 5 ETH (TVL 20,000 USDC)
  • Daily volume 50,000 USDC → fee 150 USDC/day → ~2.7% APR (before IL)
  • If ETH 2x in 1 month → IL 5.7% > fees earned

Conclusion: LP is not "passive income". You're trading off: earn fees in exchange for IL risk. Only provide liquidity when you understand this trade-off.

Comparison - Impermanent Loss vs Holding: two diverging curves


From Uniswap V2 to V3: Concentrated Liquidity — "Limit Orders in the Sun"

V2's Problem: Wasted Capital

V2: Liquidity is distributed evenly across the entire price curve (0 → ∞). But in reality, price only moves within a narrow range.

  • USDC/ETH pool at 2,000 USDC: 99% of capital sits at prices 100→10,000 USDC (never touched)
  • Only ~1% of capital actually serves swaps at the current price
  • Capital efficiency is extremely low

Uniswap V3: LPs Pick Price Ranges

V3 lets LPs provide liquidity only within a price range [a, b] where they believe price will stay.

Example: ETH = 2,000 USDC. LP believes price stays 1,800–2,200.

  • V2: Deposit full range → 1% capital efficiency
  • V3: Deposit range 1,800–2,200 → 100% capital efficiency within that range
  • Capital efficiency: 20-4000x higher depending on range width

Trade-off:

  • Narrow range = high efficiency = high fees = higher IL risk (price easily exits range)
  • Wide range = low efficiency = safer
  • If price exits range: LP holds only one token (all ETH or all USDC) → no more fees earned until price returns
Key insight: Concentrated liquidity is essentially auto-rebalancing limit orders. A V3 LP = active market maker, no longer passive like V2.

Chart - Concentrated Liquidity (Uniswap V3): price range selection vs full range


Specialized AMMs: Curve, Balancer, and Other Variants

Curve Finance: StableSwap — "AMM for Stablecoins"

Problem: USDC/USDT/DAI are all ~$1. Constant product creates unnecessary slippage.

Curve's solution: StableSwap formula (amplification parameter A):

x + y + (xy)/(x+y)  A = k

  • A = 0 → constant product (Uniswap)
  • A → ∞ → constant sum (x+y=k, fixed 1:1 price)
  • Curve uses A ~ 100-500 → extremely low slippage for stablecoins

Balancer: Weighted Pools — "Decentralized ETF"

  • Allows >2 tokens in a single pool
  • Custom weights: 80/20, 60/40, 50/50...
  • Auto-rebalancing: as prices change, the pool auto-sells appreciating tokens and buys depreciating ones → maintains target weights
  • Use cases: Index funds, portfolio management, liquidity bootstrapping

KyberSwap (Vietnamese-founded): V3 + Dynamic Fees

  • Forks Uniswap V3 + dynamic fees (raise fees when volatile, lower when stable)
  • Integrates limit orders, gasless swaps
  • Vietnam case study: First Vietnamese project to reach top 5 DEX by volume

Comparison: AMM vs CEX vs Order Book DEX

CriteriaCEX (Binance, Coinbase)Order Book DEX (dYdX, Vertex)AMM (Uniswap, PancakeSwap)
MatchingCentral, server-sideOn-chain/off-chain order bookMath formula (xy=k)
LiquidityFrom market makersFrom user limit ordersFrom LPs depositing to pool
PermissionlessNo (KYC, geo-block)PartialYes (anyone can use)
SlippageLow (deep liquidity)MediumHigh for large trades / small pools
Counterparty riskExchange collapse, frozen accountsSmart contract riskSmart contract + IL + MEV
UXEasy, fastRequires order book knowledgeSimple: connect wallet → swap
Best forInstitutions, whales, fiat on-rampPro traders, high freqRetail, new tokens, DeFi composability

Vietnam context: Vietnamese users typically start at CEX (remittance USDT/VND, P2P), then move to AMMs when they want to trade long-tail tokens or join DeFi yield. AMMs are the "gateway" to native DeFi.


Risks to Know When Using AMMs

1. Impermanent Loss (detailed above)

  • Only LPs face IL. Swappers don't.

2. Slippage & Price Impact

  • Always set slippage tolerance (default 0.5-1% on UI)
  • Large trades → split into smaller ones or use TWAP/limit orders (KyberSwap, UniswapX)

3. MEV & Sandwich Attacks

  • Bots see pending transactions in the mempool
  • Front-run: Buy before you → price rises → sell after you → risk-free profit
  • Protection: Use private RPC (Flashbots Protect), set low slippage, or use UniswapX / CowSwap (intent-based, solver competition)

4. Smart Contract Risk

  • Bug in pool code → loss of funds (e.g., Curve reentrancy 2023, Euler 2023)
  • Mitigation: Only use audited protocols with bug bounties, high TVL, and >1 year of operation

5. Rug Pull / Honeypot (Token Scam)

  • Permissionless = anyone can create a scam token pool
  • Checklist before buying a new token:

  • Contract verified on Etherscan/BscScan
  • Liquidity locked (Team Finance, Unicrypt) or burned
  • No mint, setFee, excludeFromFee privileged functions
  • Top holders < 20% supply (avoid whale dumps)
  • Has audit / community review
  • 6. Gas Fees

    • Ethereum mainnet: $5-50/swap (depending on congestion)
    • L2 (Arbitrum, Optimism, Base): $0.01-0.10
    • BSC/Polygon: $0.001-0.01
    • Tip: Use L2 or BSC for small trades to save gas

    Beginner's Guide: Swapping on Uniswap (Practical Example)

    Note: This guide is educational. Always DYOR before trading.

    Step 1: Prepare Wallet & Funds

    • Install MetaMask / Rabby / Rainbow
    • Fund with ETH (mainnet) or USDC on Base/Arbitrum (cheaper)
    • Back up your seed phrase (12 words) — NEVER SHARE IT

    Step 2: Visit Uniswap

    • Go to app.uniswap.org (check SSL, correct domain)
    • Connect wallet

    Step 3: Select Pair & Amount

    • From: Token you have (e.g., USDC)
    • To: Token you want (e.g., ETH)
    • Enter amount → check preview: output estimate, price impact, fee, route

    Step 4: Set Slippage

    • Click ⚙️ (settings)
    • Slippage tolerance: 0.5% (blue-chip tokens), 1-2% (new/volatile tokens)
    • Transaction deadline: 20 minutes (default)

    Step 5: Approve & Swap

    • First time swapping an ERC20 token → need to Approve (allow contract to use token)
    • Click Swap → Confirm in wallet
    • Wait for on-chain confirmation (15 seconds - a few minutes)

    Step 6: Verify

    • Check tx on Etherscan
    • Check balance in wallet / portfolio tracker (Zapper, DeBank, Rabby)

    FAQ: Common Questions About Automated Market Makers

    Q1: What's the difference between AMM and DEX?

    A: DEX (Decentralized Exchange) is the general concept — a non-custodial exchange. AMM is one type of DEX that uses math formulas instead of order books. Some DEXs use order books (dYdX, Vertex), others use AMMs (Uniswap, Curve). All AMMs are DEXs, but not all DEXs are AMMs.

    Q2: Why does Uniswap use xy=k instead of other formulas?

    A: xy=k has path independence — swap results depend only on net input/output, not on how you split trades. This prevents internal arbitrage and ensures fairness. Curve uses a variant for stablecoins; V3 uses "virtual reserves" for concentrated liquidity.

    Q3: Can I lose all my money providing liquidity (LP)?

    A: Not entirely unless:

    • Smart contract gets hacked (protocol rug pull)
    • One token in the pair goes to zero (e.g., scam token, stablecoin depeg)
    • You withdraw when IL is extreme + fees don't compensate

    With blue-chip pairs (ETH/USDC, BTC/USDT), total loss is very rare. The main risk is underperforming vs. holding.

    Q4: Is "impermanent loss" really "impermanent"?

    A: Only temporary if price returns to the deposit level. If you withdraw when price has diverged → loss becomes permanent. The term is misleading — many prefer "divergence loss".

    Q5: What are LP tokens? What can I do with them?

    A: LP tokens = certificates of pool ownership percentage. You can:

    • Hold to earn swap fees
    • Stake in a farm (yield farming) for additional token rewards (e.g., UNI, CAKE, KNC)
    • Use as collateral on lending platforms (Aave, Morpho — less common)
    • Burn/withdraw to get original tokens back (plus IL if any)

    Q6: How do AMMs on Ethereum vs BSC/Polygon/Base differ?

    A: Mechanics are identical (xy=k or variants). Differences:

    • Gas fees: Ethereum expensive, L2/BSC cheap
    • Available tokens: Mainnet has "mainstream" tokens, BSC has more meme/new tokens
    • Security: Ethereum most secure (high decentralization), L2 inherits Ethereum security
    • Composability: Mainnet has best composability (flash loans, atomic arb)

    Q7: How do I know which pool is "safe" for LP?

    A: Checklist:

    • [ ] TVL > $1M (lower rug pull risk)
    • [ ] Protocol audited (Trail of Bits, OpenZeppelin, ConsenSys Diligence)
    • [ ] Blue-chip token pair (ETH/USDC, WBTC/USDT, USDC/USDT)
    • [ ] Appropriate fee tier (0.05% stable, 0.3% standard, 1% volatile)
    • [ ] Not a pool "incentivized" only by token inflation (fake APR)

    Q8: Is Uniswap V3 better than V2 for beginners?

    A: Not recommended for beginners to LP on V3. V3 requires:

    • Active position management (rebalance when price exits range)
    • Understanding "impermanent loss" by range
    • Higher gas fees for mint/burn positions

    Beginners should swap on V3 (better prices via concentrated liquidity) but LP on V2 or Curve stablecoin pools to learn basics first.

    Q9: Is there a way to hedge impermanent loss?

    A: Several methods (advanced):

    • Single-sided LP: Deposit only one token (Bancor V3, KyberSwap Elastic) — protocol supplies the other, shares IL
    • IL Protection: Bancor, Tokemak offer IL insurance (after 100 days of LP)
    • Delta-neutral strategy: LP + short perpetual futures on CEX (hedge price) — complex, costs funding fees
    • Concentrated stablecoin range: LP USDC/USDT range 0.99-1.01 → IL near zero

    Q10: Will AMMs completely replace CEXs in the future?

    A: Not exactly. Each model has its role:

    • CEX: Fiat on/off-ramp, compliance, institutional custody, high-frequency trading
    • AMM: Permissionless innovation, long-tail assets, DeFi composability, 24/7 global access

    Future: Hybrid — CEXs integrate AMMs (Binance Liquid Swap), AMMs add limit orders (UniswapX), intent-based solvers bridge both.


    Conclusion: AMMs — The Gateway to DeFi

    Automated market makers have turned "market making" from a privilege of large institutions into a right of anyone with a crypto wallet. From the simple xy=k formula to sophisticated concentrated liquidity, AMMs embody the power of code replacing intermediaries.

    Key takeaways:

    1. AMM = Liquidity pool + Auto-pricing formula

    2. Constant product (xy=k) is the foundation — understanding it means understanding 80% of AMMs

    3. Impermanent loss is the opportunity cost of LPing — not "free interest"

    4. Uniswap V3 = Auto-rebalancing limit orders — powerful but complex

    5. Safety first: Check contracts, lock liquidity, set slippage, mind gas, DYOR

    For users in Vietnam and emerging markets: AMMs open access to global finance without needing a bank, visa, or referral. Vietnamese projects (KyberSwap, Coin98, TomoChain) have proven: from an AMM, you can build a global protocol.

    Next step: Try a small swap on Uniswap (Base/Arbitrum) or KyberSwap with $10-20 to experience it. Practice is the best teacher — but only use money you can afford to lose.

    SEO Keywords

    • Primary: automated market makers
    • Secondary: amm defi, how amm works, constant product formula, impermanent loss, uniswap v3, concentrated liquidity, liquidity pool

    This article is educational, not financial advice. DeFi carries high risk. Always DYOR and only invest money you can afford to lose.*

    Tags:

    automated market makerswhat is automated market makersautomated market makers guide