1. Introduction to the Pricing Mechanism on DEX and CEX

On centralized exchanges (CEX) like Binance, the price of tokens is determined by the order book, where buyers and sellers place orders to trade. However, on decentralized exchanges (DEX) like Uniswap, PancakeSwap, prices are not determined by an order book but by an automated market maker (AMM).

1.1 Pricing Mechanism on CEX

CEX operates based on an order book model and matching engine. The price of tokens is determined by supply and demand through two main order types:

  • Limit Order: Users place buy/sell orders at their desired price, waiting for others to match the order.

  • Market Order: An order that is executed immediately at the best available price on the order book.

The price of a token at a given time on CEX is the price of the highest buy order (bid) and the lowest sell order (ask). The difference between these two price levels is called the spread.

*** Therefore, you will often incur fees when opening and closing orders due to this spread.

1.2 Pricing Mechanism on DEX

The AMM mechanism uses a mathematical function to determine the price of tokens based on supply and demand at the moment of trading. The core formula of the AMM model is:

X * Y = K

Where:

  • x = the amount of token A in the pool

  • y = the amount of token B in the pool (usually stablecoin or another token)

  • k = liquidity constant (always unchanged unless liquidity is added or withdrawn)

2. Token Pricing Mechanism When Trading on DEX

2.1 When Users Buy Tokens (Price Increases)

When someone buys token A with token B:

  • They deposit token B into the pool.

  • The pool provides back token A.

  • Due to the decrease in the amount of token A and the increase in the amount of token B, the price of token A will rise.

The new price formula after buying a certain amount of token B:

For example:

  • Assume a pool has 1000 token A and 10,000 USDT. The initial price is each token.

  • A person buys 100 token A, meaning they need to send into.

  • After the transaction, the pool has 900 token A and 11,000 USDT.

  • New price =, meaning the price has increased.

2.2 When Users Sell Tokens (Price Decreases)

Similarly, when someone sells token A to receive token B:

  • They send token A into the pool.

  • The pool returns token B.

  • The amount of token A in the pool increases, token B decreases → the price of token A decreases.

The new price formula after selling token A:

3. Compare Pricing Mechanisms Between CEX and DEX

compare pricing mechanisms cex vs dex

4. Strategies and Considerations When Trading on DEX

4.1 How to Reduce Slippage

  • Break down the trade orders instead of buying/selling a large quantity at once.

  • Check the liquidity of the pool before trading.

  • Use the 'Slippage Tolerance' feature on DEX to set the maximum slippage you can accept.

4.2 Avoiding Fake Marketcap Traps

A token with a large marketcap but a small liquidity pool can make the price easily manipulable. Please check:

  • Marketcap/TVL (Total Value Locked) Ratio: If marketcap is too high compared to TVL, it could be a warning signal.

  • The number of holders is large or small: If only a few addresses hold most of the tokens, the risk of a sell-off is very high.

5. Conclusion

The AMM model allows trading on DEX to occur completely automatically without an intermediary. However, the differences between DEX and CEX lead to many factors to consider such as slippage, pool liquidity, and price manipulation potential. Meanwhile, CEX has higher liquidity and lower spreads, but relies on third parties. Understanding the pricing formulas and trading strategies can help you optimize profits and reduce risks when participating in the crypto market.