Trade on Swap
Transaction Process: Token Trading Based on the AMM Model
Below is a detailed description of the transaction process and how to understand the AMM model and slippage:
1. Go to the Swap Page and Select the Trading Function
On the Swap page, you can select the trading function to start buying or selling Tokens.
You can use mainstream assets (such as BNB, ETH, or USDT, depending on your trading pair) to buy the Token you issued.
Similarly, you can sell your Tokens to exchange them back for mainstream assets.
Transactions are based on the Automated Market Maker (AMM) model, which allows trading without waiting for buyers or sellers, enabling 24/7 trading anytime, anywhere.
2. How Pricing Works: AMM’s M × N = K Formula
The price of a transaction is determined by the AMM model’s formula:
Where:
M is the quantity of the mainstream asset in the liquidity pool.
N is the quantity of the Token in the liquidity pool.
K is a constant value representing the invariant product of the liquidity pool, assuming no liquidity is added or removed.
When you buy Tokens:
The amount of the mainstream asset in the liquidity pool increases, while the quantity of Tokens decreases, causing the Token price to rise.
When you sell Tokens:
The quantity of Tokens in the liquidity pool increases, while the amount of the mainstream asset decreases, causing the Token price to fall.
What Is Slippage?
Slippage refers to the difference between the expected price and the actual transaction price due to changes in the quantity of assets in the liquidity pool during the trade.
Reasons for Slippage:
The liquidity pool has a finite quantity of assets, and every transaction changes the pool’s ratio, which affects the price.
Larger transaction amounts cause greater price changes, resulting in higher slippage.
Example of Slippage:
Assume the liquidity pool contains 1,000 units of the mainstream asset and 1,000 Tokens, with an initial price of 1 mainstream asset = 1 Token.
If you use 100 units of the mainstream asset to buy Tokens, the pool’s mainstream asset amount will increase to 1,100, and the Token amount will decrease to 909.09 (calculated using the M × N = K formula).
The new price becomes 1.21 mainstream assets = 1 Token, meaning the average price you paid for the Tokens is higher than the initial price, resulting in slippage.
How to Reduce Slippage
To minimize the impact of slippage, you can:
Reduce transaction size: Smaller trades have less impact on the liquidity pool ratio, thus reducing slippage.
Choose pools with high liquidity: Higher liquidity means more assets in the pool, leading to smaller price changes and lower slippage.
Set a slippage tolerance: During a trade, you can set a slippage tolerance range (e.g., 0.5% or 1%). If the slippage exceeds this range, the transaction will automatically cancel, preventing losses from excessive slippage.
Last updated