What is the Bonding Phase?

The bonding phase is the initial trading period where tokens are bought and sold directly from a smart contract using an algorithmic pricing curve. Think of it as a decentralized pre-sale with automatic market making.

How Bonding Works

The Bonding Curve Mechanism

During bonding, the contract acts as the sole market maker:
  1. No Order Book: Prices determined algorithmically
  2. Instant Liquidity: Always able to buy or sell
  3. Path Independence: Price depends only on supply, not history
  4. Automatic Pricing: No manual price setting needed

Trading Operations

Buying Tokens

Process Flow:
  1. User sends ETH/B3 to contract
  2. Contract calculates tokens based on curve
  3. 5% fee deducted and sent to recipient
  4. Tokens minted and sent to buyer
  5. Curve state updated
Code Example:
// Get a quote first
const quote = await token.getAmountOfTokensToBuy(
  parseEther("1") // 1 ETH
);
console.log(`Will receive: ${formatEther(quote)} tokens`);

// Execute purchase with slippage protection
const minTokens = quote * 0.95n; // 5% slippage
await token.buy(minTokens, "1");

Selling Tokens

Process Flow:
  1. User approves token spending
  2. User calls sell with token amount
  3. Contract calculates ETH based on curve
  4. 5% fee deducted from proceeds
  5. ETH sent to seller, tokens burned
  6. Curve state updated (price decreases)
Code Example:
// Check balance and get quote
const balance = await token.balanceOf(userAddress);
const sellAmount = balance / 2n; // Sell half

const quote = await token.getAmountOfEthToReceive(
  sellAmount
);
console.log(`Will receive: ${formatEther(quote)} ETH`);

// Execute sale with slippage protection
const minEth = quote * 0.95n; // 5% slippage
await token.sell(sellAmount, minEth);

Fee Structure

How Fees Work

Fee Economics

Daily VolumeFee IncomeMonthly Income
10 ETH0.5 ETH~15 ETH
50 ETH2.5 ETH~75 ETH
100 ETH5 ETH~150 ETH
500 ETH25 ETH~750 ETH

Target Mechanics

Understanding the Target

The target is the amount of ETH/B3 that must be accumulated before migration:
Target Purpose:
  • Ensures sufficient liquidity for Uniswap v4
  • Creates a clear goal for the community
  • Prevents premature migration
  • Builds momentum during bonding

Approaching the Target

// Monitor progress toward target
async function trackProgress(token: BondkitToken) {
  const progress = await token.getBondingProgress();
  
  if (progress.progress < 0.5) {
    console.log("🌱 Early stage - best prices available");
  } else if (progress.progress < 0.8) {
    console.log("🚀 Momentum building - consider buying");
  } else if (progress.progress < 1.0) {
    console.log("🔥 Almost there - migration imminent");
  } else {
    console.log("✅ Target reached - ready to migrate!");
  }
  
  const remaining = progress.threshold - progress.raised;
  console.log(`Need ${formatEther(remaining)} more ETH`);
}

Overflow Handling

When a purchase would exceed the target:
  1. Partial Fill: Only the amount needed is accepted
  2. Automatic Refund: Excess returned in same transaction
  3. Fair Completion: No one can overpay at the end
Example Scenario:
Target: 100 ETH
Current: 99.5 ETH
User sends: 2 ETH

Result:
- 0.5 ETH accepted (reaches exactly 100 ETH)
- 1.5 ETH refunded
- User gets tokens for 0.5 ETH
- Migration now available

Events & Monitoring

Contract Events

event BondingCurveBuy(
    address indexed payer,
    address indexed recipient,
    uint256 tradingTokenIn,
    uint256 tokensOut,
    uint256 fee,
    uint256 totalRaisedBonding
);
Listening in SDK:
token.onBuy((event) => {
  console.log({
    buyer: event.payer,
    ethSpent: formatEther(event.tradingTokenIn),
    tokensReceived: formatEther(event.tokensOut),
    feePaid: formatEther(event.fee),
    totalRaised: formatEther(event.totalRaisedBonding)
  });
});

Real-Time Monitoring

// Complete monitoring setup
class BondingMonitor {
  constructor(private token: BondkitToken) {}
  
  async start() {
    // Initial state
    const progress = await this.token.getBondingProgress();
    console.log(`Starting at ${(progress.progress * 100).toFixed(2)}%`);
    
    // Monitor buys
    this.token.onBuy(async (event) => {
      const newProgress = await this.token.getBondingProgress();
      console.log(`BUY: ${formatEther(event.tokensOut)} tokens`);
      console.log(`Progress: ${(newProgress.progress * 100).toFixed(2)}%`);
      
      if (newProgress.progress >= 1.0) {
        console.log("🎆 TARGET REACHED! Migration available.");
      }
    });
    
    // Monitor sells
    this.token.onSell(async (event) => {
      const newProgress = await this.token.getBondingProgress();
      console.log(`SELL: ${formatEther(event.tokensIn)} tokens`);
      console.log(`Progress: ${(newProgress.progress * 100).toFixed(2)}%`);
    });
  }
}

// Usage
const monitor = new BondingMonitor(token);
await monitor.start();

Bonding Phase Strategies

For Token Creators

Build Momentum

  • Start with lower aggressiveness (30-50)
  • Set achievable targets
  • Engage community early
  • Provide clear roadmap

Maximize Success

  • Seed initial liquidity yourself
  • Create buying incentives
  • Time announcements well
  • Plan for post-migration

For Traders

Entry Strategy

  • Buy early for best prices
  • Use DCA for large amounts
  • Monitor aggressiveness factor
  • Check target progress

Risk Management

  • Always use slippage protection
  • Understand price impact
  • Don’t FOMO near target
  • Plan exit strategy

Post-Bonding Transition

Critical: After MigrationOnce migrateToDex() is called:
  • ❌ Bonding curve trading permanently disabled
  • ❌ No more buy() or sell() functions
  • ✅ All trading moves to Uniswap v4
  • ✅ Standard AMM mechanics apply
  • ✅ Anyone can provide liquidity
  • ✅ Fully decentralized trading

Next Steps