Bonding curve mechanics
No order book, no market maker, no liquidity to seed. One constant-product formula prices every trade against the curve's own reserves.
The formula
The curve keeps two numbers: virtual_sol_reserves and
virtual_token_reserves. Their product is held constant:
k = virtual_sol_reserves × virtual_token_reserves
On a buy, SOL comes in and the invariant is solved for the new token reserves:
new_virtual_sol = virtual_sol_reserves + sol_in
new_virtual_token = k ÷ new_virtual_sol
tokens_out = virtual_token_reserves − new_virtual_token
Selling runs the same formula in reverse: tokens in, SOL out. There's no separate pricing logic for buys vs. sells; it's the same curve either direction.
Virtual vs. real reserves
The curve tracks two pairs of reserves:
- Virtual reserves: used only for pricing math. They start well above the real supply so the token has a sane, non-zero starting price and smooth price action, instead of a chart that starts at zero or divides by a tiny number.
- Real reserves: the actual SOL sitting in the curve and actual tokens sitting in its vault.
real_sol_reservesis the jackpot pot;real_token_reservesis what's left to buy.
Every trade updates both pairs together. Virtual reserves move by the same formula, and real reserves move by the exact amount of SOL/tokens that actually changed hands.
Default curve shape
These are the parameters used when a curve auto-initializes on its first buy (a curve's authority can also set custom values via an explicit initialize_curve call before anyone buys):
| Parameter | Default |
|---|---|
| Token decimals | 6 |
| Total supply | 1,000,000,000 tokens |
| Initial virtual SOL reserves | 30 SOL |
| Initial virtual token reserves | 1,073,000,000 tokens |
| Target SOL reserves (completion) | 85 SOL |
Virtual token reserves (1.073B) start above the real total supply (1B) on purpose. That gap is what gives the token a real starting price instead of an undefined one.
Price impact
Because price is a ratio of reserves, not a fixed number, every trade moves it. A small buy relative to the reserves barely moves the price; a large one moves it a lot, the same way a big market order does against a thin order book, except here it's deterministic and quoted before you confirm. The terminal shows this as Price impact, color-coded once it gets steep.
Curve completion
The curve completes the instant either condition is met:
real_sol_reservesreaches the target (85 SOL by default), orreal_token_reserveshits zero (the vault is fully bought out).
In practice the SOL target is almost always what triggers it first, since buying the literal last token requires paying an asymptotically large amount of SOL, so the target is the realistic finish line. What happens at that exact moment is covered in The Jackpot.