Skip to main content

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.
The most common types are:

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

Where:
  • 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
Why virtual reserves? The virtual reserves create artificial depth at launch, preventing the first buyer from getting 100% of tokens for pennies. The 30 SOL virtual reserve means the price starts as if there’s already 30 SOL of liquidity.

Price Calculation

The price (exchange rate) is calculated as:
In code:
To get the token price in SOL:

Initial Parameters

When a Pumpfun token is created, the bonding curve initializes with:
Note: The total supply is 1B tokens, but only ~793.1M are available for purchase. The difference (~280M) is the virtual reserve that creates initial price depth.

How Buying Works

When you buy tokens:
  1. You send SOL to the bonding curve
  2. The curve calculates tokens using the constant product formula:
  1. Both virtual AND real reserves update:
    • virtualSolReserves += sol_in
    • virtualTokenReserves -= tokens_out
    • realSolReserves += sol_in
    • realTokenReserves -= tokens_out

How Selling Works

When you sell tokens:

Bonding Percentage

The bonding progress shows how close the token is to migration:
When tokens are bought, virtualTokenReserves decreases. The bonding percentage tracks what % of the initialRealTokenReserves has been purchased.

Bonding (Migration) Threshold

When virtualSolReserves >= ~85 SOL, the token “bonds” and migrates to Raydium:
Since virtual SOL starts at 30 SOL, approximately 55-56 SOL of real purchases triggers migration.

Price Impact Formula

For a given SOL input, the price impact is:
Example: If virtual SOL reserves = 30 SOL and you buy with 3 SOL, your price impact is ~9.1%. Early buys have massive impact because of the relatively low virtual reserve.

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
After 10 SOL buy:
  • 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:
To get the actual price:

The Curve Structure

Meteora DBC defines a curve as an array of price/liquidity points:
This creates a piecewise linear bonding curve where:
  • 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:
When bondingPercentage >= 100%, the token migrates to Meteora DAMM.

Migration Thresholds


Comparison: Pumpfun vs Meteora DBC


Practical Applications

1. Predicting Bonding Time

For Pumpfun:
For Meteora DBC:

2. Price Impact Estimation

For a buy of X SOL on Pumpfun:

3. Slippage Calculation

4. Calculating Token Price in USD


API Access

Query bonding curve data through Mobula’s API:
The response includes:
  • bonded - Whether the token has migrated to Raydium/Meteora
  • bondingPercentage - Progress toward migration (0-100)
  • bondingCurveAddress - Address of the bonding curve contract
  • preBondingFactory - 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.