KaiaFun
App
  • 📘Introduction
    • 🏝️Overview
    • 🎒Background
  • User Guide
    • 🔔How to launch
    • 📈How to trade
    • 🔥How to halt selling
    • ✅Token Contract Verification
  • Protocol
    • 🧮Mechanism
    • 🏦Protocol Fees
    • ♻️The $WEERO Token
    • ⚡Flashloans
    • 📜Content Policy
  • More
    • 🎨Brand Kit
    • 🐦X/Twitter
Powered by GitBook
On this page
  • 🪄 The Bonding Curve (Exponential)
  • 💸 Valuation
  • Initial Price
  • Total Supply
  • Initial Virtual Liquidity
  • Initial Market Cap
  • 📈 Price/Profit Projection on the Time of Migration (1/2)
  • Migration Threshold
  • Final Token Price
  • Total KAIA Raised
  • CPMM model after migration
  • Migrated KAIA Liquidity
  • Liquidity Fees
  • 🧮 Mathematical Analysis (2/2)
  • Price Increase
  • Market Cap at Migration
  • Bonding Curve Constant
  1. Protocol

Mechanism

PreviousToken Contract VerificationNextProtocol Fees

Last updated 1 month ago

🪄 The Bonding Curve (Exponential)

The bonding curve mechanism used in KaiaFun initially follows an Exponential model. The equation for this curve is:

P(x)=P0⋅ek⋅xP(x) = P_0 \cdot e^{k \cdot x}P(x)=P0​⋅ek⋅x

Where:

  • P(x)P(x)P(x) is the price of the token at a given point

  • P0P_0P0​ is the initial price

  • kkk is a constant that determines the steepness of the curve

  • xxx is the percentage of tokens sold (ranging from 0 to 1)

The value of kkk can be derived from the initial and target prices:

k=ln⁡(PtargetP0)k = \ln(\frac{P_{\text{target}}}{P_0})k=ln(P0​Ptarget​​)

💸 Valuation

Initial Price

The optimal initial token price is 0.0000183 KAIA per token.

Total Supply

Token total supply remains 1 Billion.

With 18 decimal places matching the native token, it is defined in base units as:

Initial Virtual Liquidity

Token Reserves

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

Initial market cap can be calculated as:

Where:

📈 Price/Profit Projection on the Time of Migration (1/2)

Migration Threshold

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 constants at the time of protocol deployment.

Using the exponential bonding curve model, we can calculate various metrics at the time of migration:

Final Token Price

The final token price when the migration threshold is reached:

Total KAIA Raised

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.

CPMM model after migration

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.

Migrated KAIA Liquidity

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.

Liquidity Fees

The amount of KAIA remaining after DEX deployment:

🧮 Mathematical Analysis (2/2)

Price Increase

We can calculate the percentage increase in token price from initial to final:

Market Cap at Migration

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.

Bonding Curve Constant

PTokeninitial/KAIA=0.0000183 KAIAP_{\text{Token}_\text{initial}/\text{KAIA}} = 0.0000183 \text{ KAIA}PTokeninitial​/KAIA​=0.0000183 KAIA
Ts=1,000,000,000T_s = 1,000,000,000Ts​=1,000,000,000
Tsunits=1,000,000,000×1018T_{\text{s}_\text{units}} = 1,000,000,000 \times 10^{18}Tsunits​​=1,000,000,000×1018

Therefore initial reserves for the token (RtinitialR_{t_{initial}}Rtinitial​​) is:

Rtinitial=Ts×80100=800,000,000R_{t_{initial}} = T_s \times \frac{80}{100} = 800,000,000Rtinitial​​=Ts​×10080​=800,000,000
Market CapTokenfinal=Ts×PTokeninitial/KAIA×PKAIA/USD=1,000,000,000×0.0000183 KAIA×0.127 USD≈2,324.1 USD\text{Market Cap}_{\text{Token}_\text{final}} = T_s \times P_{\text{Token}_\text{initial}/\text{KAIA}} \times P_\text{KAIA/USD} \\ = 1,000,000,000 \times 0.0000183 \text{ KAIA} \times 0.127 \text{ USD} \approx 2,324.1 \text{ USD}Market CapTokenfinal​​=Ts​×PTokeninitial​/KAIA​×PKAIA/USD​=1,000,000,000×0.0000183 KAIA×0.127 USD≈2,324.1 USD

TsT_sTs​ is the total supply of KAIA tokens

PTokeninitial/KAIAP_{\text{Token}_\text{initial}/\text{KAIA}}PTokeninitial​/KAIA​ is the initial price of the token

PKAIA/USDP_\text{KAIA/USD}PKAIA/USD​ is the price of KAIA in USD

Migration ThresholdKAIA=546,614 KAIA\text{Migration Threshold}_\text{KAIA} = 546,614 \text{ KAIA}Migration ThresholdKAIA​=546,614 KAIA
Migration ThresholdUSD≈546,614×0.127=69,419.978 USD≈69,420 USD\text{Migration Threshold}_\text{USD} \approx 546,614 \times 0.127 = 69,419.978 \text{ USD} \approx 69,420 \text{ USD}Migration ThresholdUSD​≈546,614×0.127=69,419.978 USD≈69,420 USD
PTokenfinal/KAIA=0.000546614173228346 KAIAP_{\text{Token}_\text{final}/\text{KAIA}} = 0.000546614173228346 \text{ KAIA}PTokenfinal​/KAIA​=0.000546614173228346 KAIA
ΔRb≈124,424.78 KAIA\Delta R_b \approx 124,424.78 \text{ KAIA}ΔRb​≈124,424.78 KAIA
x∗y=kx * y = kx∗y=k

xxx represents the base token reserves (e.g. Wrapped KAIA)

yyy represents the token reserves (i.e. Newly launched token on top of KaiaFun)

kkk is a constant

P=xyP = \frac{x}{y}P=yx​
Δy=y−kx+Δx\Delta y = y - \frac{k}{x + \Delta x}Δy=y−x+Δxk​
Δx=x−ky+Δy\Delta x = x - \frac{k}{y + \Delta y}Δx=x−y+Δyk​

Δx\Delta xΔx is the amount of base tokens added or removed

Δy\Delta yΔy is the amount of tokens bought or sold

Rbfinal=PTokenfinal/KAIA×(Ts−Rtinitial)≈109,322.83464567 KAIAR_{b_{final}} = P_{\text{Token}_\text{final}/\text{KAIA}} \times (T_s - R_{t_{initial}}) \approx 109,322.83464567 \text{ KAIA}Rbfinal​​=PTokenfinal​/KAIA​×(Ts​−Rtinitial​​)≈109,322.83464567 KAIA
Remaining KAIA=ΔRb−Rbfinal≈15,101.946011 KAIA\text{Remaining KAIA} = \Delta R_b - R_{b_{final}} \approx 15,101.946011 \text{ KAIA}Remaining KAIA=ΔRb​−Rbfinal​​≈15,101.946011 KAIA
Price Increase=PTokenfinal/KAIA−PTokeninitial/KAIAPTokeninitial/KAIA×100%=0.000546614173228346−0.00001830.0000183×100%≈2,886.96%\text{Price Increase} = \frac{P_{\text{Token}_\text{final}/\text{KAIA}} - P_{\text{Token}_\text{initial}/\text{KAIA}}}{P_{\text{Token}_\text{initial}/\text{KAIA}}} \times 100\% \\ = \frac{0.000546614173228346 - 0.0000183}{0.0000183} \times 100\% \approx 2,886.96\%Price Increase=PTokeninitial​/KAIA​PTokenfinal​/KAIA​−PTokeninitial​/KAIA​​×100%=0.00001830.000546614173228346−0.0000183​×100%≈2,886.96%
Market CapKAIA=Ts×PTokenfinal/KAIA=1,000,000,000×0.000546614173228346=546,614.173228346 KAIA\text{Market Cap}_\text{KAIA} = T_s \times P_{\text{Token}_\text{final}/\text{KAIA}} \\ = 1,000,000,000 \times 0.000546614173228346 = 546,614.173228346 \text{ KAIA}Market CapKAIA​=Ts​×PTokenfinal​/KAIA​=1,000,000,000×0.000546614173228346=546,614.173228346 KAIA
Market CapUSD=546,614.173228346×0.127≈69,419.9999999999 USD\text{Market Cap}_\text{USD} = 546,614.173228346 \times 0.127 \approx 69,419.9999999999 \text{ USD}Market CapUSD​=546,614.173228346×0.127≈69,419.9999999999 USD

We can calculate the constant kkk that defines our exponential curve:

k=ln⁡(PTokenfinal/KAIAPTokeninitial/KAIA)=ln⁡(0.0005466141732283460.0000183)≈3.396842143109809886k = \ln(\frac{P_{\text{Token}_\text{final}/\text{KAIA}}}{P_{\text{Token}_\text{initial}/\text{KAIA}}}) \\ = \ln(\frac{0.000546614173228346}{0.0000183}) \approx 3.396842143109809886k=ln(PTokeninitial​/KAIA​PTokenfinal​/KAIA​​)=ln(0.00001830.000546614173228346​)≈3.396842143109809886
🧮