Skip to main content

What Are Bonding Curves?

A bonding curve is an automated market maker (AMM) that determines token price based on supply. As more tokens are bought, the price increases along a mathematical curve. As tokens are sold back, the price decreases. Think of it like this:
  • First buyer gets the cheapest price
  • Last buyer before graduation pays the highest price
  • Everyone in between pays fair market price based on current supply
The curve doesn’t care who you are, everyone pays the same price at the same supply level.

Why Bonding Curves?

Fair Launch

No pre-sales, no insider allocations. The curve doesn’t care who you are, everyone pays the same price at the same supply level.
// At launch
creatorBalance = 0;
teamBalance = 0;
insiderBalance = 0;

// Everyone buys from the curve

Automatic Liquidity

The curve itself is the market maker. No need to seed liquidity pools or wait for market makers. Trading starts instantly.

Immediate Trading

Buy and sell from day one

Always Liquid

Curve always provides liquidity

No Rug Risk

Liquidity locked in the curve

Fair Pricing

Math determines price, not humans

Price Discovery

Price finds its natural level based on net buying demand. High net demand (more buys than sells) -> price rises. Equal buys and sells -> price stays stable.

No Rug Risk

Liquidity is locked in the curve until graduation. Creators can’t pull funds. The only way out is through trading or graduation.

RektHub’s Bonding Curve Design

The Numbers

When you launch a token on RektHub:
1

Total Supply: 1 Billion Tokens

Fixed supply, no inflation, no additional minting
2

Tradeable Supply: 850 Million

Available on the bonding curve for trading
3

Reserved Supply: 150 Million

Held for DEX graduation (creates liquidity pump)
4

Virtual Token Reserves: 1.073 Billion

Used for pricing calculations (smooth early prices)
5

Virtual Native Reserves: Varies by Chain

Calibrated for similar starting prices across all chains (~1.5 ETH equivalent)

Virtual Native Reserves by Chain

Virtual native reserves are calibrated per chain to maintain consistent pricing dynamics:
All chains using ETH as native token:
Virtual Native Reserve: 1.5 ETH
Applies to: Ethereum, Base, Arbitrum, Optimism, Zircuit, Lisk, Scroll (and their testnets)
Note: Throughout this documentation, we use 30 ETH in examples for easier math visualization. On mainnet, RektHub uses 1.5 ETH for ETH-based chains, which provides identical pricing curve dynamics.
// Total supply
TOTAL_SUPPLY = 1,000,000,000 * 10^18

// Real reserves (actual tokens)
REAL_TOKEN_RESERVES = 850,000,000 * 10^18  // Tradeable
RESERVED_FOR_DEX = 150,000,000 * 10^18     // Graduation

// Virtual reserves (pricing)
VIRTUAL_TOKEN_RESERVES = 1,073,000,000 * 10^18
VIRTUAL_NATIVE_RESERVES = varies  // ~1.5 ETH equivalent
Note: Throughout this documentation, we use 30 ETH in examples for easier math visualization. On mainnet, RektHub uses ~1.5 ETH equivalent as the virtual native reserve, which provides the same pricing curve dynamics with more efficient capital allocation.

Virtual vs Real Reserves

Understanding the difference between virtual and real reserves is key to understanding bonding curves.
Real reserves are actual tokens and native currency in the curve contract. These are what traders receive.
// At launch
realNativeReserves = 0 ETH
realTokenReserves = 850,000,000 tokens
		
// After first buy (0.1 ETH spent, 1% fee)
realNativeReserves = 0.099 ETH  // (0.1 - 1% fee)
realTokenReserves = 815,722,813 tokens  // Some sold

The Constant Product Formula

RektHub uses the time-tested constant product formula from Uniswap:
x × y = k
Where:
  • x = virtual native reserves
  • y = virtual token reserves
  • k = constant (product of x and y)
When you buy tokens:
  1. Fee deducted from input first (0.99 ETH enters calculation)
  2. Native goes in -> x increases
  3. Tokens come out -> y decreases
  4. k stays constant (maintains the curve)
// Before buy
x = 30 ETH
y = 1,073,000,000 tokens
k = 30 × 1,073,000,000 = 32,190,000,000

// User spends 1 ETH, 1% fee deducted first
amountAfterFee = 1 - (1 × 0.01) = 0.99 ETH
newX = 30 + 0.99 = 30.99 ETH

// Calculate new y to maintain k
newY = k / newX = 32,190,000,000 / 30.99 = 1,038,722,168 tokens

// Tokens out
tokensOut = y - newY = 34,277,832 tokens
Note: This is a simplified calculation skeleton. The full implementation includes token transfers, edge case handling, and additional checks. See the contract on GitHub for the complete logic.
When you sell tokens:
  1. Tokens go in -> y increases
  2. Native comes out -> x decreases (gross amount for k calculation)
  3. k stays constant
  4. Fee deducted from output (user receives 99% of calculated amount)
// User sells 10,000,000 tokens
newY = 1,073,000,000 + 10,000,000 = 1,083,000,000

// Calculate new x to maintain k
newX = k / newY = 32,190,000,000 / 1,083,000,000 = 29.722 ETH

// Native out (before fees)
nativeOutBeforeFee = x - newX = 0.278 ETH

// Apply 1% fee
nativeOut = 0.278 × 0.99 = 0.275 ETH (user receives this)
Note: This is a simplified calculation skeleton. The full implementation includes native transfers, reserve updates, fee distribution, and additional checks. See the contract on GitHub for the complete logic.

Price Discovery Example

Let’s trace how price evolves as a token gains traction:
1

Launch (0 ETH traded in)

Virtual native: 30 ETH
Virtual tokens: 1,073,000,000
Price per token: 0.00000002796 ETH
Market cap: ~28 ETH
2

Early Stage (~9.9 ETH net traded in)

Virtual native: ~39.9 ETH
Virtual tokens: ~804,750,000
Price per token: 0.00000004957 ETH (~1.77x)
Market cap: ~49.6 ETH
3

Growing (~99 ETH net traded in)

Virtual native: ~129 ETH
Virtual tokens: ~249,534,884
Price per token: 0.000000517 ETH (~18.5x)
Market cap: ~517 ETH
4

Bonding (850M tokens sold)

Virtual native: ~506 ETH
Virtual tokens: ~223,000,000
Curve price: 0.00000227 ETH (~81x from launch)

DEX Launch (after 12% fee on 506 ETH):
445.28 ETH + 150M tokens
DEX price: 0.00000297 ETH (~106x from curve launch)
These are examples. Actual prices depend on trading volume and demand. The curve ensures fair pricing at every stage. The graduation multiplier depends on accumulated liquidity and the 12% migration fee.

The Trading Lifecycle

Phase 1: Active Trading

Your token launches with 850M tokens available on the curve. Anyone can buy or sell. Price moves up with buys, down with sells.
// User spends 1 ETH
1. Calculate fee: 1 ETH × 1% = 0.01 ETH
2. Net amount: 1 - 0.01 = 0.99 ETH
3. Calculate tokens from curve: ~34M tokens
4. Transfer tokens to buyer
5. Update reserves

// Reserves after (both use net amount)
realNativeReserves += 0.99 ETH
realTokenReserves -= 34M
virtualNativeReserves += 0.99 ETH
virtualTokenReserves -= 34M
Real reserves grow: Every buy adds native currency (net). Real token reserves decrease as tokens are sold. Virtual reserves adjust: Track alongside real reserves to maintain pricing formula. Both use net on buys (fee taken before swap) and gross on sells (fee taken after swap calculation).

Phase 2: Bonding Achieved

When 850 million real tokens are sold, your token is bonded. This means:

All Supply Sold

All tradeable tokens have been purchased

Liquidity Accumulated

Mathematically determined amount of native currency

Ready for Graduation

Token can now migrate to a DEX

Trading Stops

No more buys/sells on the curve
// Bonding state (mathematically determined)
{
  realTokenReserves: 0,              // All 850M sold
  realNativeReserves: 114.35 ETH,    // Determined by constant k
  reservedTokens: 150M,              // Ready for DEX
  status: "bonded",
  readyForGraduation: true
}
You cannot trade after bonding. The token must graduate to a DEX to become tradeable again.

Phase 3: Graduation to DEX

The creator triggers graduation. The remaining 150M tokens and accumulated native liquidity migrate to the chosen DEX.
1

Migration Fee Charged

12% of liquidity (e.g., 13.72 ETH from 114.35 ETH)
2

Liquidity Sent to DEX

100.63 ETH + 150M tokens create LP position
3

LP Tokens Locked/Burned

No rug pull risk
4

Trading Opens on DEX

Token now tradeable on Uniswap/PancakeSwap/etc.
The price calculation: When 150M tokens pair with the accumulated ETH (minus 12% fee), the DEX launch price is determined by this ratio. Using the 30 ETH virtual example: 100.63 ETH ÷ 150M tokens = 0.000000671 ETH per token. The accumulated liquidity at bonding is mathematically determined by the constant product formula.
Multiple factors create upward price pressure:
  1. Instant liquidity depth: 88% of accumulated ETH creates strong buy support
  2. Supply squeeze: Only 150M tokens vs 850M that were on the curve
  3. FOMO effect: “I missed the curve, buying on DEX”
  4. Price discovery: New trading venue, new price action
This rewards early believers who bought on the curve at low prices.

Technical Deep Dive

Constants

// Token economics
uint256 public constant TOTAL_SUPPLY = 1_000_000_000 * 10**18;
uint256 public constant REAL_TOKEN_RESERVES = 850_000_000 * 10**18;
uint256 public constant VIRTUAL_TOKEN_RESERVES = 1_073_000_000 * 10**18;

// Fee structure
uint256 private constant PROTOCOL_FEE_BPS = 100;  // 1%
uint256 private constant CREATOR_SHARE_BPS = 3000;  // 30% of fee
uint256 private constant BASIS_POINTS = 10000;

Buy Calculation

function buy(uint256 nativeIn) returns (uint256 tokensOut) {
    // 1. Calculate fee
    uint256 fee = nativeIn * PROTOCOL_FEE_BPS / BASIS_POINTS;
    uint256 creatorFee = fee * CREATOR_SHARE_BPS / BASIS_POINTS;
    uint256 platformFee = fee - creatorFee;

    // 2. Net amount for trading
    uint256 netAmount = nativeIn - fee;

    // 3. Calculate tokens out (constant product)
    uint256 calculatedTokens = (netAmount * virtualTokenReserves) /
                                (virtualNativeReserves + netAmount);

    // 4. Take minimum (handles last buyer edge case)
    tokensOut = calculatedTokens < realTokenReserves
                ? calculatedTokens
                : realTokenReserves;

    // 5. Update reserves (both use net amount - fee already deducted)
    virtualNativeReserves += netAmount;
    realNativeReserves += netAmount;
    virtualTokenReserves -= tokensOut;
    realTokenReserves -= tokensOut;

    // 6. Accumulate creator fee
    accumulatedCreatorFees += creatorFee;

    // 7. Send platform fee to factory
    factory.transfer(platformFee);

    // Note: Token transfer to buyer and additional logic omitted
    // See full contract on GitHub for complete implementation
}

Sell Calculation

function sell(uint256 tokensIn) returns (uint256 nativeOut) {
    // 1. Calculate gross native out (constant product)
    uint256 grossNative = (tokensIn * virtualNativeReserves) /
                          (virtualTokenReserves + tokensIn);

    // 2. Check reserves
    require(grossNative <= realNativeReserves, "Insufficient reserves");

    // 3. Calculate fee
    uint256 fee = grossNative * PROTOCOL_FEE_BPS / BASIS_POINTS;
    uint256 creatorFee = fee * CREATOR_SHARE_BPS / BASIS_POINTS;
    uint256 platformFee = fee - creatorFee;

    // 4. Net to user
    nativeOut = grossNative - fee;

    // 5. Update reserves (both use gross - fee sent separately)
    virtualTokenReserves += tokensIn;
    realTokenReserves += tokensIn;
    virtualNativeReserves -= grossNative;
    realNativeReserves -= grossNative;

    // 6. Accumulate creator fee
    accumulatedCreatorFees += creatorFee;

    // 7. Send platform fee to factory
    factory.transfer(platformFee);

    // Note: Native transfer to seller and additional logic omitted
    // See full contract on GitHub for complete implementation
}

Slippage Protection

Every trade includes a minOut parameter:
// Buy with slippage protection
require(tokensOut >= minTokensOut, "Slippage exceeded");

// Sell with slippage protection
require(nativeOut >= minNativeOut, "Slippage exceeded");
Always use slippage protection. Prices move between quote and execution, protect your users.

Why This Model Works

  • No upfront capital needed (no liquidity to seed)
  • Earn from every trade (30% of fees)
  • Control graduation destination
  • Massive migration reward (60% of 12% fee)
  • Fair price at low supply
  • Accumulate before bonding
  • Benefit from graduation price bump
  • Trade with confidence (liquidity locked)
  • Everyone trades on equal terms
  • Price reflects genuine demand
  • No rug risk from liquidity pulls
  • Clear path to DEX graduation
  • Sustainable fee model funds development
  • No platform token needed
  • Scales to any chain with bonding curve support
  • Proven mechanics, no experiments

Next Steps