Bonding Curve
Understand pricing with virtual reserves, settlement with actual reserves, and the relationship between buying, selling, and graduation.
Virtual Token and BNB reserves form a constant-product issuance curve. Buys consume Token along the curve; selling back replenishes sale inventory. Pricing reserves and actual-asset ledgers are separate.
Initial parameters and four reserve types
| Symbol | Meaning | Initial value |
|---|---|---|
| X | Virtual Token reserve | 11,070,367,520 Token |
| Y | Virtual BNB reserve | 6.14 BNB |
| R | Actual Token inventory available for sale | 8,000,000,000 Token |
| Q | Actual BNB reserves | 0 BNB |
| S | Curve-supply basis for protocol market cap | 10,000,000,000 Token |
Initial virtual BNB is used only for pricing, not deposited startup capital. Virtual Token is not additional minted supply. Sales can be paid only from actual reserves.
Prices and net curve amounts
Ignoring integer rounding, virtual reserves satisfy k = X × Y. The current marginal price is P = Y / X with protocol market cap based on fixed curve supply: M = floor(Y × S / X). A large order’s average execution price differs from the marginal price.
For a specified purchase quantity a, net BNB entering the curve is:
n = ceil(Y × a / (X − a))
X' = X − a Y' = Y + n
R' = R − a Q' = Q + n
For a specified sell-back quantity a, gross BNB deducted from the actual curve ledger is:
g = floor(Y × a / (X + a))
X' = X + a Y' = Y − g
R' = R + a Q' = Q − g
These formulas describe the net amount entering the curve and the gross amount leaving it, rather than the wallet’s final payment or receipt. See the tax chapter for Token taxes. Use the relevant quote entry point’s return values for transaction budgets and received amounts.
Three trading entry points
Budget buys use the contract’s integer quote path. Effective pricing input reserves one smallest native-asset unit, namely net − 1; it still counts toward actual curve reserves, so do not replace this path with an ordinary floating-point constant-product formula. If requested output exceeds remaining inventory, requote using actual output.
From execution to migration
Buying reduces R; selling back increases R. Ordinary wallet transfers do not change curve progress. Completion requires R = 0 and the final successful purchase triggers external migration in the same transaction. A fixed fundraising amount or market cap cannot replace this condition.
Selling requires 0 < g ≤ Q and inventory after selling back cannot exceed initial sale inventory. The final purchase must also pass migration checks; migration failure reverts the entire final purchase.
Integration and display
- Calculate using raw integers, then format for display. Rounding buy costs up and gross sale amounts down are not interchangeable.
- Use actual executed amounts and contract return values; do not label requested quantity as filled quantity.
- Quotes do not reserve inventory. Deadlines, slippage, and reserves at execution still affect the result.
- Read curve accounting separately from Factory’s total balance. Direct donations do not automatically increase a Token’s recorded actual curve reserves.