🧮Mechanism
Last updated
Last updated
The bonding curve mechanism used in KaiaFun initially follows an Exponential model. The equation for this curve is:
Where:
is the price of the token at a given point
is the initial price
is a constant that determines the steepness of the curve
is the percentage of tokens sold (ranging from 0 to 1)
The value of can be derived from the initial and target prices:
The optimal initial token price is 0.0000183 KAIA per token.
Token total supply remains 1 Billion.
With 18 decimal places matching the native token, it is defined in base units as:
80% of the total supply, equivalent to 800,000,000 tokens, is reserved into the virtual pool and tradeable via the bonding curve. The remaining 20%, constituting 200,000,000 tokens, is deployed to the DEX upon migration.
Initial market cap can be calculated as:
Where:
The migration threshold is set at 546,614 KAIA, which is equivalent to approximately $69,420 at a KAIA price of $0.127. This specific value was chosen as a meme number.
Using the exponential bonding curve model, we can calculate various metrics at the time of migration:
The final token price when the migration threshold is reached:
The total amount of KAIA raised through the bonding curve:
In production, this value can contain a small margin of error due to the approximate operations performed in smart contracts.
After reaching the migration threshold, the system transitions from the exponential bonding curve to a Constant Product Market Maker (CPMM, or CPAMM) model for the DEX. The CPMM follows the equation:
Where:
The price of the token at any point can be calculated as:
For buying tokens:
For selling tokens:
Where:
To maintain price continuity during this transition, we need to calculate the appropriate KAIA liquidity to deploy to the DEX that matches the final price in the bonding curve.
The amount of KAIA needed for DEX liquidity is calculated to match the final price in the bonding curve after migration to CPMM:
This ensures that the initial price in the CPMM DEX matches the final price of the exponential bonding curve, providing a smooth transition for traders.
The amount of KAIA remaining after DEX deployment:
We can calculate the percentage increase in token price from initial to final:
The market cap at the time of migration can be calculated as:
Assuming a KAIA market price of $0.127, the market cap in USD is:
Which matches the target market cap.
Therefore initial reserves for the token () is:
is the total supply of KAIA tokens
is the initial price of the token
is the price of KAIA in USD
represents the base token reserves (e.g. Wrapped KAIA)
represents the token reserves (i.e. Newly launched token on top of KaiaFun)
is a constant
is the amount of base tokens added or removed
is the amount of tokens bought or sold
We can calculate the constant that defines our exponential curve: