起源学习站链上学习学院 › Level 3 DeFi 基础 › 什么是 AMM(自动做市商)?ORIGIN LearnOn-chain Academy › Level 3 DeFi Basics › What is an AMM?
💧 Level 3 · DeFi 基础💧 Level 3 · DeFi Basics

什么是 AMM(自动做市商)?What is an AMM (Automated Market Maker)?

7 分钟7 min
学习目标:学完你能理解 AMM 用资金池加公式自动定价的原理,知道 x 乘 y 等于 k 是怎么回事,以及为什么买得越多价格越贵。Learning goal: after this lesson you'll understand how an AMM prices automatically using a liquidity pool plus a formula, what "x times y equals k" is about, and why the more you buy, the more expensive it gets.
大白话In plain wordsAMM 就像一台自动售货机,价格不由人喊,而是由「池子里还剩多少货」按公式算出来——货越少,价越贵。An AMM is like a vending machine: the price isn't quoted by a person but calculated by a formula from "how much stock is left in the pool" — the less stock, the higher the price.

AMM 是自动做市商(Automated Market Maker)。传统交易靠买卖双方挂单撮合,而 AMM 换了个思路:把两种代币放进一个资金池,价格由一条数学公式自动算出,不需要有人挂单等对手。AMM stands for Automated Market Maker. Traditional trading matches buyers and sellers via an order book, but an AMM takes a different approach: put two tokens into a liquidity pool, and the price is calculated automatically by a math formula — no one needs to post an order and wait for a counterparty.

最经典的公式是恒定乘积:x 乘 y 等于 k。x 和 y 是池里两种币的数量,k 保持不变。你拿走一部分 A 币,池里 A 变少、B 变多,公式就自动把 A 的价格抬上去。The most classic formula is the constant product: x times y equals k. Here x and y are the amounts of the two tokens in the pool, and k stays constant. When you take some token A out, A in the pool drops and B rises, so the formula automatically pushes A's price up.

这带来一个直觉规律:This leads to some intuitive rules:

所以 AMM 的价格是「算」出来的,不是「喊」出来的。理解这一点,你就明白了为什么大额交易滑点大、为什么小池子价格容易被拉动——这都是公式在起作用。So an AMM's price is "calculated", not "quoted" by anyone. Once you get this, you understand why large trades have big slippage and why small pools have prices that are easily moved — it's all the formula at work.

案例Example一个池子里有 100 个 A 和 100 个 B,k 就是 10000。你想拿走一些 A,池里 A 减少,公式要求 B 增加来维持 k 不变,于是你拿的 A 越多,需要付的 B 就越多,等于价格越买越贵。A pool holds 100 A and 100 B, so k is 10,000. You want to take out some A; A in the pool drops, and the formula requires B to rise to keep k constant. So the more A you take, the more B you must pay — meaning the price gets more expensive the more you buy.
配套工具(点开在主站打开):Related tools (open on the main site):
🛠 区块浏览器 ›🛠 Block Explorer ›

📝 本节测验📝 Quiz

1. AMM 靠什么给代币定价?1. How does an AMM price tokens?

2. 最经典的恒定乘积公式是?2. What is the classic constant-product formula?

3. 你从池子里买走越多某种币,会发生什么?3. The more of a token you buy out of the pool, what happens?

4. 池子越大,通常意味着什么?4. A bigger pool usually means what?

5. AMM 里价格是怎么变化的?5. How does the price change in an AMM?

❓ 常见问题❓ FAQ

AMM 和普通挂单撮合哪个更好?Which is better — an AMM or an ordinary order book?

没有绝对好坏。AMM 胜在随时有报价、无需对手,适合链上;挂单撮合在大额和精细定价上更灵活。两者各有适用场景。There's no absolute better or worse. An AMM wins by always having a quote and needing no counterparty, which suits on-chain use; an order book is more flexible for large sizes and fine pricing. Each has its own use cases.

为什么小池子的币价容易被拉高拉低?Why is the price in a small pool easy to pump or dump?

因为池子浅,少量买卖就能大幅改变两种币的比例,公式随之把价格拉动很大。深池子则稳得多。Because the pool is shallow, even a small trade can greatly change the ratio of the two tokens, and the formula then moves the price a lot. A deep pool is far more stable.

AMM 里看到的价格是真实市场价吗?Is the price you see in an AMM the real market price?

它是这个池子按公式算出的价,可能和其他平台略有差异。跨平台价差过大时要留意,别只看单一池子的报价。It's the price this pool calculates by its formula, which may differ slightly from other platforms. Be cautious when the price gap across platforms is too large — don't rely on a single pool's quote.

‹ 上一课‹ Previous什么是 DEX(去中心化交易所)?What is a DEX?