When talking about decentralized exchanges, you first need to understand the core difference between them and centralized exchanges.
**Order Book vs Automated Market Maker**
The major exchanges and mainstream platforms we usually use are primarily order book models—if you want to buy coins, you need to find someone willing to sell; if you want to sell coins, you wait for someone to take the other side. The exchange acts as a matchmaker, connecting buyers and sellers according to their needs. It’s like a traditional market, where sellers quote prices, buyers negotiate, and transactions are finalized.
Decentralized exchanges operate on a different logic called Automated Market Makers, or AMM. There are no counterparties of buyers and sellers; instead, there are “liquidity pools.” Think of it as a vending machine—you put in coins and, according to fixed rules, you can exchange for another coin, all without third-party matching.
**Core Formula of Liquidity Pools**
Each trading pair has its own liquidity pool. The pool contains two assets (for example, ETH and USDT), which are deposited by liquidity providers. When users trade, they interact directly with this pool—if you want to buy ETH, you exchange from the pool, and at the same time, you need to deposit an equivalent value of USDT into the pool.
AMM is supported by a famous formula:
**x × y = k**
Here, x is the amount of the first token in the pool, y is the amount of the second token, and k is a constant. No matter how you trade, k remains unchanged. This formula determines the exchange price—buy more, and the unit price gets higher; sell more, and the unit price gets lower. That’s why large orders tend to cause slippage.
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
24 Likes
Reward
24
10
Repost
Share
Comment
0/400
NftBankruptcyClub
· 01-08 20:12
Oh wow, x×y=k, I already knew that. The key is how to survive within the slippage.
View OriginalReply0
TokenomicsShaman
· 01-08 13:26
I've been tired of the x*y=k formula for a long time; the slippage is really incredible.
View OriginalReply0
FadCatcher
· 01-08 12:05
Damn, this x×y=k thing. I took forever to understand it, and the slippage is really incredible.
View OriginalReply0
SwapWhisperer
· 01-08 09:58
The analogy of the vegetable market is brilliant; finally, someone explained AMM more clearly. However, be careful with slippage.
View OriginalReply0
AirdropFatigue
· 01-08 09:58
The analogy of the vegetable market is brilliant; it turns out we've been dealing with vending machines all along, no wonder slippage is so outrageous.
View OriginalReply0
PumpDoctrine
· 01-08 09:57
Damn, once the x×y=k formula is out, no one can beat it. Slippage just skyrockets.
View OriginalReply0
retroactive_airdrop
· 01-08 09:49
Haha, the formula x×y=k has already been exploited to death. Slippage is truly next level.
View OriginalReply0
WhaleShadow
· 01-08 09:48
The analogy of the vegetable market is brilliant; finally, someone explained AMM clearly. However, the slippage part is really a big pitfall.
View OriginalReply0
YieldWhisperer
· 01-08 09:47
x*y=k This formula is really brilliant; it instantly explains why large orders are so easily wiped out.
View OriginalReply0
down_only_larry
· 01-08 09:41
Damn, the formula x*y=k is really awesome. Now I understand why my large orders always get eaten up by slippage.
When talking about decentralized exchanges, you first need to understand the core difference between them and centralized exchanges.
**Order Book vs Automated Market Maker**
The major exchanges and mainstream platforms we usually use are primarily order book models—if you want to buy coins, you need to find someone willing to sell; if you want to sell coins, you wait for someone to take the other side. The exchange acts as a matchmaker, connecting buyers and sellers according to their needs. It’s like a traditional market, where sellers quote prices, buyers negotiate, and transactions are finalized.
Decentralized exchanges operate on a different logic called Automated Market Makers, or AMM. There are no counterparties of buyers and sellers; instead, there are “liquidity pools.” Think of it as a vending machine—you put in coins and, according to fixed rules, you can exchange for another coin, all without third-party matching.
**Core Formula of Liquidity Pools**
Each trading pair has its own liquidity pool. The pool contains two assets (for example, ETH and USDT), which are deposited by liquidity providers. When users trade, they interact directly with this pool—if you want to buy ETH, you exchange from the pool, and at the same time, you need to deposit an equivalent value of USDT into the pool.
AMM is supported by a famous formula:
**x × y = k**
Here, x is the amount of the first token in the pool, y is the amount of the second token, and k is a constant. No matter how you trade, k remains unchanged. This formula determines the exchange price—buy more, and the unit price gets higher; sell more, and the unit price gets lower. That’s why large orders tend to cause slippage.