4: Direct launchlab integration

For developers who want to integrate directly with the Raydium LaunchLab program without using this SDK.

Core Concepts

Program Information

Program ID: 9SkAtSxgNUMvT9bGb93v6rLU5MjW1XibykqoGtqT9dbg

Key Accounts:

  • Global Config: 6s1xP3hpbAfFoNtUNF8mfHsjr2Bd97JxFJRWLbL6aHuX

  • Platform Config: 3pcjttVo7W1eTYFjTfBTrWKm1YmWU2RXY6GKND3svqYi

  • Vault Authority: WLHv2UAZm6z4KyaaELi5pjdbJh6RESMva1Rnn8pJVVh

  • SOL Mint: So11111111111111111111111111111111111111112

Program State Machine

Pools exist in three states:

Status
Value
Description

Funding

0

Initial phase - accepting trades, fundraising in progress

Migrate

1

Fundraising complete - waiting for migration to AMM

Trade

2

Migrated to AMM - trading occurs on Raydium AMM V4

Critical Account Derivations

All accounts use Program Derived Addresses (PDAs) — deterministic addresses derived from seeds.

Pool State (Bonding Curve)

Main pool account that stores all state.

Seed components:

  • Constant: "pool" (UTF-8 bytes)

  • Base Mint: Token mint public key (32 bytes)

  • Quote Mint: WSOL mint public key (32 bytes)


Vault Authority

PDA that has authority over all vault operations.

Seed: "vault_auth_seed" (UTF-8 bytes)


Base Vault (Token Vault)

Holds the pool's base tokens (the tokens being sold).

Seed components:

  • Constant: "pool_vault"

  • Pool State: Pool state PDA (32 bytes)

  • Base Mint: Token mint public key (32 bytes)


Quote Vault (SOL Vault)

Holds the pool's quote tokens (WSOL/SOL).


Platform Fee Vault

Collects platform fees.


Creator Fee Vault

Collects creator fees.


Event Authority

Used for emitting program events.

Seed: "__event_authority"


Metadata Account (Metaplex)

Stores token metadata (name, symbol, URI).


Manual Transaction Construction

Buy Tokens (buy_exact_in)

Instruction Discriminator: [250, 234, 13, 123, 213, 156, 19, 236]

Accounts (in order):

Index
Account
Writable
Signer
Description

0

payer

User wallet

1

authority

Vault authority PDA

2

global_config

Global config

3

platform_config

Platform config

4

pool_state

Pool state PDA

5

user_base_token

User's token account (ATA)

6

user_quote_token

User's WSOL account (ATA)

7

base_vault

Pool's base vault

8

quote_vault

Pool's quote vault

9

base_token_mint

Token mint

10

quote_token_mint

WSOL mint

11

base_token_program

Token program

12

quote_token_program

Token program

13

event_authority

Event authority PDA

14

program

LaunchLab program ID

15

system_program

System program

16

platform_vault

Platform fee vault

17

creator_vault

Creator fee vault

Instruction data (8 bytes discriminator + 8 bytes amount_in + 8 bytes min_amount_out + 8 bytes share_fee_rate):

Pre-instructions required:

1

Create WSOL Account (if it doesn't exist)

2

Transfer SOL to WSOL Account

3

Sync Native (wrap SOL)

Full transaction example:


Sell Tokens (sell_exact_in)

Instruction Discriminator: [149, 39, 222, 155, 211, 124, 152, 26]

Accounts: Same as buy_exact_in (see above)

Instruction data:

Post-instructions required:


Create Token (initialize_v2)

Instruction Discriminator: [67, 153, 175, 39, 218, 16, 38, 32]

This is the most complex instruction. It requires:

1

Token mint keypair

Token mint keypair (must be a signer).

2

Metadata

Metadata URI uploaded to IPFS/Arweave.

3

Multiple PDAs

Several PDAs must be derived (pool state, vaults, event authority, fee vaults, metadata PDA, etc.).

4

Anchor-encoded instruction data

Anchor method call with the appropriate structured args (see example).

Simplified example using Anchor Program interface:


Reading Pool State

Manual Deserialization

Pool state is stored in the PoolState account using Borsh serialization.

Account structure (selected fields):

Field
Offset
Size
Type
Description

epoch

0

8

u64

Update epoch

auth_bump

8

1

u8

Authority bump seed

status

9

1

u8

Pool status (0/1/2)

base_decimals

10

1

u8

Token decimals

quote_decimals

11

1

u8

WSOL decimals (always 9)

migrate_type

12

1

u8

Migration type

supply

16

8

u64

Total supply

total_base_sell

24

8

u64

Total base for sale

virtual_base

32

8

u64

Virtual base reserves

virtual_quote

40

8

u64

Virtual quote reserves

real_base

48

8

u64

Real base reserves

real_quote

56

8

u64

Real quote reserves

total_quote_fund_raising

64

8

u64

Fundraising goal

...

...

...

...

...

creator

280

32

Pubkey

Token creator

Using Borsh deserialization with Anchor coder:

Manual parsing (without Anchor):


Last updated