Documentation Index
Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
Use this file to discover all available pages before exploring further.
Bonding Curves: The Mathematics of Fair Launches
Bonding curves are smart contract mechanisms that automatically determine token prices based on supply and demand. They enable fair launches where everyone trades against the same mathematical formula, eliminating the need for market makers and preventing price manipulation.Why it matters: Understanding bonding curve math helps you predict price movements, identify bonding thresholds, and build trading strategies around launchpad tokens.
What is a Bonding Curve?
A bonding curve is a mathematical function that defines the relationship between a token’s price and its supply. As tokens are bought, the price increases along the curve. As tokens are sold, the price decreases.| Curve Type | Formula | Characteristics |
|---|---|---|
| Constant Product (x*y=k) | price = k / supply | Hyperbolic curve, used by Pumpfun |
| Exponential | price = base^supply | Aggressive price growth |
| Linear | price = m * supply + b | Predictable, steady growth |
| Sqrt Price | price = sqrtPrice² / 2^128 | Concentrated liquidity, used by Meteora DBC |
Pumpfun: Constant Product AMM
Pumpfun uses a constant product Automated Market Maker (AMM) with virtual reserves. This is the same formula popularized by Uniswap V2.Core Formula
x= Virtual SOL reserves (reserve0)y= Virtual Token reserves (reserve1)k= Constant product (invariant)
Understanding Virtual vs Real Reserves
Critical Concept: Pumpfun uses TWO types of reserves:
- Virtual Reserves: Used for price calculation (includes “phantom” liquidity)
- Real Reserves: Actual tokens/SOL locked in the contract
| Reserve Type | SOL | Token | Purpose |
|---|---|---|---|
| Virtual | virtualSolReserves | virtualTokenReserves | Price calculation via AMM formula |
| Real | realSolReserves | realTokenReserves | Actual assets in contract |
| Initial Virtual | 30 SOL | 1,073,000,000,000,000 | Starting point for price curve |
| Initial Real Token | 0 SOL | 793,100,000,000,000 | Tokens available for sale |
Price Calculation
The price (exchange rate) is calculated as:Initial Parameters
When a Pumpfun token is created, the bonding curve initializes with:| Parameter | Value | Description |
|---|---|---|
initialVirtualSolReserves | 30 SOL (30,000,000,000 lamports) | Virtual SOL for price calculation |
initialVirtualTokenReserves | 1,073,000,000,000,000 | Virtual tokens (6 decimals = ~1.073B) |
initialRealTokenReserves | 793,100,000,000,000 | Actual tokens for sale (~793.1M) |
bondedCriteria | 85.005 SOL | Real SOL to trigger migration |
How Buying Works
When you buy tokens:- You send SOL to the bonding curve
- The curve calculates tokens using the constant product formula:
- Both virtual AND real reserves update:
virtualSolReserves += sol_invirtualTokenReserves -= tokens_outrealSolReserves += sol_inrealTokenReserves -= tokens_out
How Selling Works
When you sell tokens:Bonding Percentage
The bonding progress shows how close the token is to migration:virtualTokenReserves decreases. The bonding percentage tracks what % of the initialRealTokenReserves has been purchased.
Bonding (Migration) Threshold
WhenvirtualSolReserves >= ~85 SOL, the token “bonds” and migrates to Raydium:
Price Impact Formula
For a given SOL input, the price impact is:Numerical Example
At launch:- Virtual SOL: 30,000,000,000 lamports (30 SOL)
- Virtual Tokens: 1,073,000,000,000,000 (1.073B with 6 decimals)
- Exchange rate: 1,073B / 30 = 35,766,666,666 tokens per SOL
- Token price: 30 / 1,073B = 0.000000028 SOL per token
- Tokens received: (10 × 1,073B) / (30 + 10) = 268,250,000,000 tokens (~268M)
- New Virtual SOL: 40 SOL
- New Virtual Tokens: 804,750,000,000,000 (804.75B)
- New exchange rate: 804.75B / 40 = 20,118,750,000 tokens per SOL
- Price increased by ~44%
Meteora DBC: Dynamic Bonding Curve
Meteora’s Dynamic Bonding Curve (DBC) uses a sqrt price model with concentrated liquidity, similar to Uniswap V3 but optimized for launchpads.Core Concept: Sqrt Price
Instead of storing price directly, Meteora DBC stores the square root of price as a Q64.64 fixed-point number:The Curve Structure
Meteora DBC defines a curve as an array of price/liquidity points:- Each segment has different liquidity concentration
- Price moves faster in segments with lower liquidity
- Price moves slower in segments with higher liquidity
Quote Reserve Calculation
The virtual quote (SOL) reserve is calculated by integrating along the curve:Delta Amount Formula
For each curve segment:Bonding Percentage
Meteora DBC calculates bonding progress as:bondingPercentage >= 100%, the token migrates to Meteora DAMM.
Migration Thresholds
| Parameter | Description |
|---|---|
migrationQuoteThreshold | SOL amount needed to trigger migration |
sqrtPriceStart | Initial sqrt price |
curve | Array of (sqrtPrice, liquidity) points defining the curve shape |
Comparison: Pumpfun vs Meteora DBC
| Aspect | Pumpfun | Meteora DBC |
|---|---|---|
| Curve Type | Constant Product (x*y=k) | Sqrt Price with Concentrated Liquidity |
| Price Formula | SOL / Token | sqrtPrice² / 2^128 |
| Liquidity Distribution | Uniform across all prices | Concentrated in curve segments |
| Price Impact | Higher for same volume | Variable based on liquidity concentration |
| Bonding Trigger | 86 SOL raised | Custom migrationQuoteThreshold |
| Migration Target | Raydium | Meteora DAMM |
| Complexity | Simple | More complex, more flexible |
Practical Applications
1. Predicting Bonding Time
For Pumpfun:2. Price Impact Estimation
For a buy ofX SOL on Pumpfun:
3. Slippage Calculation
4. Calculating Token Price in USD
API Access
Query bonding curve data through Mobula’s API:bonded- Whether the token has migrated to Raydium/MeteorabondingPercentage- Progress toward migration (0-100)bondingCurveAddress- Address of the bonding curve contractpreBondingFactory- Original launchpad (e.g., Pumpfun, Meteora DBC)liquidityUSD- Current liquidity in the curve
For real-time bonding curve updates, use the WSS Market Details WebSocket stream.