Raydium LaunchLab Rust SDK
A Rust SDK for interacting with the Raydium LaunchLab program on Solana.
Program ID: LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj
Features
- 🛒 Buy/Sell tokens on bonding curve pools
- 🚀 Initialize new launchpad pools
- 💰 Claim fees (creator, platform, protocol)
- 🔒 Vesting token management
- 🔄 Migration to AMM/CPSwap
Installation
Add to your Cargo.toml:
[]
= { = "../raydiumlaunchlab-rust-sdk" }
Quick Start
Buy Tokens
use ;
use Pubkey;
// Derive pool state PDA
let = get_pool_state_pda;
// Fetch pool state
let pool_data = client.get_account_data?;
let pool = try_from_bytes?;
// Build buy instruction
let buy_ix = buy_exact_in;
Sell Tokens
let sell_ix = sell_exact_in;
Convenience Functions
// Auto-derive all accounts
let buy_ix = create_buy_instruction;
PDA Derivation
use pda;
// Pool State
let = get_pool_state_pda;
// Pool Vaults
let = get_pool_vault_pda;
let = get_pool_vault_pda;
// Authority
let = get_authority_pda;
// Global Config
let = get_global_config_pda;
// Platform Config
let = get_platform_config_pda;
// Vesting Record
let = get_vesting_record_pda;
Account Structures
PoolState
use PoolState;
let pool = try_from_bytes?;
// Status checks
pool.is_funding; // Pool accepting funds
pool.is_migrate; // Waiting for migration
pool.is_trading; // Migration complete
// Pool info
pool.get_current_price; // Quote per base
pool.get_funding_progress; // Percentage funded
// Token program detection
pool.is_base_token_2022; // Base uses Token-2022
pool.is_quote_token_2022; // Quote uses Token-2022
Instructions
| Instruction | Description |
|---|---|
buy_exact_in |
Buy base tokens with specified quote amount |
buy_exact_out |
Buy specified amount of base tokens |
sell_exact_in |
Sell specified amount of base tokens |
sell_exact_out |
Sell to receive specified quote amount |
initialize |
Create new launchpad pool |
initialize_v2 |
Create pool with AMM fee option |
claim_creator_fee |
Claim creator trading fees |
claim_platform_fee |
Claim platform fees |
claim_vested_token |
Claim vested tokens |
create_vesting_account |
Create vesting for beneficiary |
migrate_to_amm |
Migrate to Raydium AMM |
migrate_to_cpswap |
Migrate to CPSwap |
Examples
Run the examples:
License
MIT