The Math Behind Bonding Curves
How the constant product formula actually works. The equations and why they produce fair pricing.
What is a Bonding Curve?
A bonding curve is a mathematical function that determines token price based on supply. More tokens sold = higher price. This creates automatic price discovery without order books.
The Formula
Spawned uses a linear bonding curve:
Price = BasePrice + (Slope × CurrentSupply)
Where:
- BasePrice: Starting price (very low)
- Slope: Rate of price increase
- CurrentSupply: Tokens already sold
Practical Example
Settings:
- Base price: 0.000001 SOL
- Slope: 0.00000001 per token
- Current supply: 100,000,000 tokens sold
Current price:
0.000001 + (0.00000001 × 100,000,000) = 1.000001 SOL
Why Linear?
Linear curves provide:
- Predictability: Easy to calculate future prices
- Fairness: Gradual price increases
- Stability: No sudden price cliffs
Market Cap Calculation
Market cap = Token price × Circulating supply
At any point on the curve, you can calculate:
- What buying X tokens will cost
- What selling X tokens will return
- Implied market cap
Liquidity Mechanics
The bonding curve IS the liquidity. No LPs needed. The protocol holds SOL reserves equal to all purchases minus fees. This guarantees you can always sell.
Reserve Formula
Reserve = ∫(Price)dSupply = BasePrice×Supply + (Slope×Supply²)/2
Graduation Trigger
When the bonding curve collects 85 SOL in reserves (minus fees), the token "graduates" to Raydium with real liquidity pools.
Arbitrage Prevention
The bonding curve eliminates arbitrage opportunities because there's only one market maker: the curve itself. Price is deterministic based on supply, preventing front-running and sandwich attacks common on DEXes.
Slippage
Large trades still experience slippage because buying tokens increases price during the trade. The UI shows expected price impact before confirming.
Related Articles
Bonding Curves Explained Simply
What bonding curves are and how they set token prices. No math degree needed.
Holder Rewards Technical Deep Dive
How the accumulator pattern works, the math behind rewards, and how the smart contract handles it all.
Our Solana Smart Contract Architecture
How the Urge Launchpad program is structured. PDAs, accounts, and how instructions flow through.
Ready to try it?
Build your first app in a few minutes.
Start Building