Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Token Launchpad

Fair launch token launchpad platform with bonding curves and liquidity bootstrapping on Solana.

TypeScript Rust Solana License

Overview

A decentralized token launchpad enabling fair token launches with bonding curve mechanics. Similar to pump.fun but with additional features for creator control and investor protection.

Features

  • Bonding curve token sales
  • Automatic liquidity migration to Raydium
  • Customizable curve parameters
  • Anti-snipe protection
  • Creator vesting schedules
  • Real-time price charts
  • Mobile-responsive UI

How It Works

  1. Create Token: Deploy a new token with custom metadata
  2. Bonding Curve: Token price follows a bonding curve formula
  3. Trading: Users buy/sell against the curve
  4. Migration: When threshold is reached, liquidity migrates to Raydium
  5. Trading Continues: Token becomes freely tradeable on DEX

Bonding Curve Math

Price = Base × (1 + Supply / Scale)^Exponent

Default parameters:
- Base: 0.00001 SOL
- Scale: 800,000,000 tokens
- Exponent: 1.5

Architecture

├── src/
│   ├── contracts/        # Anchor smart contracts
│   │   ├── launchpad.rs  # Main launchpad program
│   │   └── bonding.rs    # Bonding curve implementation
│   ├── lib/
│   │   ├── curve.ts      # Curve calculations
│   │   └── client.ts     # SDK client
│   └── components/
│       ├── CreateToken.tsx
│       ├── TokenCard.tsx
│       └── BondingChart.tsx
└── tests/
    └── launchpad.test.ts

Smart Contract

Instructions

Instruction Description
create_token Deploy new token with bonding curve
buy Buy tokens from bonding curve
sell Sell tokens to bonding curve
migrate Migrate liquidity to Raydium
withdraw Creator withdraws fees

Accounts

#[account]
pub struct BondingCurve {
    pub creator: Pubkey,
    pub mint: Pubkey,
    pub vault: Pubkey,
    pub virtual_sol_reserves: u64,
    pub virtual_token_reserves: u64,
    pub real_sol_reserves: u64,
    pub real_token_reserves: u64,
    pub migration_threshold: u64,
    pub is_migrated: bool,
    pub bump: u8,
}

Client SDK

import { LaunchpadClient } from './src/lib/client';

const client = new LaunchpadClient(connection, wallet);

// Create new token
const { mint, bondingCurve } = await client.createToken({
  name: 'My Token',
  symbol: 'MTK',
  description: 'An example token',
  image: 'https://...',
  migrationThreshold: 85 * LAMPORTS_PER_SOL, // 85 SOL
});

// Buy tokens
const result = await client.buy({
  bondingCurve,
  solAmount: 0.1 * LAMPORTS_PER_SOL,
  minTokens: 1000000,
});

// Sell tokens
await client.sell({
  bondingCurve,
  tokenAmount: 500000,
  minSol: 0.04 * LAMPORTS_PER_SOL,
});

// Get price
const price = await client.getPrice(bondingCurve);
console.log(`Current price: ${price} SOL`);

Fee Structure

Fee Amount Recipient
Trade Fee 1% Platform
Creator Fee Optional Creator
Migration Fee 0.5 SOL Platform

Security

  • Audited smart contracts
  • Anti-bot measures (min/max buy)
  • Creator vesting to prevent rugs
  • Liquidity locked on migration

Development

# Install dependencies
npm install

# Build contracts
anchor build

# Run tests
anchor test

# Start frontend
npm run dev

Configuration

# RPC
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com

# Program IDs
LAUNCHPAD_PROGRAM_ID=Launch111111111111111111111111111111111111
RAYDIUM_PROGRAM_ID=675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8

License

MIT License - see LICENSE for details.


Built by @Sugusdaddy

About

Fair launch token launchpad platform with bonding curves and liquidity bootstrapping

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages