Skip to main content

Launchpad Program Reference

Complete reference for the Launchpad orchestrator program that manages token launches end-to-end.

Program ID: 8zfW4iLA7JagfotwCn8FT3SpdzUyGQ7CRSzjMwmJyK6F Framework: Anchor 0.29.0

Account Types

ProtocolConfig

Singleton global protocol configuration.

PDA Seeds: ["cca_protocol"] Size: 434 bytes (8 discriminator + 426 fields)

FieldTypeDescription
adminPubkeyCurrent admin authority
pending_adminPubkeyPending admin for 2-step transfer
treasuryPubkeyProtocol fee destination account
protocol_fee_bpsu16Protocol fee in basis points (max 10,000)
pausedboolPauses new launch creation
settlement_pausedboolPauses settlement pipeline
min_auction_duration_slotsu64Minimum allowed auction duration
max_auction_duration_slotsu64Maximum allowed auction duration
min_floor_priceu128Minimum allowed floor price (Q96)
min_total_supplyu64Minimum total token supply
max_total_supplyu64Maximum total token supply
min_auction_bpsu16Minimum auction allocation %
max_auction_bpsu16Maximum auction allocation %
max_team_bpsu16Maximum team allocation %
min_lp_bpsu16Minimum LP allocation %
min_lp_proceeds_bpsu16Minimum LP proceeds %
allowed_quote_mints[Pubkey; 4]Whitelist of accepted quote token mints
num_allowed_quote_mintsu8Number of valid entries
raydium_cpmm_programPubkeyRaydium CPMM program ID
raydium_amm_configPubkeyRaydium AMM config account
emergency_timeout_slotsu64Slots after finalization before emergency withdraw
min_lp_proceedsu64Minimum absolute LP proceeds
cca_programPubkeyCCA V2 program ID
bumpu8PDA bump seed

LaunchConfig

Per-launch configuration storing all parameters and state.

PDA Seeds: ["cca_launch", creator, launchId (u64 LE)] Size: 551 bytes (8 discriminator + 543 fields)

FieldTypeDescription
authorityPubkeyCreator who initiated the launch
launch_idu64Unique launch identifier per creator
token_mintPubkeyToken-2022 mint created for this launch
quote_mintPubkeyQuote token mint
auction_configPubkeyCCA V2 AuctionConfig account (set in step 3)
total_supplyu64Total token supply
auction_bpsu16% of supply for auction
lp_bpsu16% of supply for LP pool
team_bpsu16% of supply for team
lp_proceeds_bpsu16% of auction proceeds going to LP
protocol_fee_bpsu16Protocol fee snapshot
settlement_stateSettlementStateCurrent lifecycle state
final_clearing_priceu128Clearing price from CCA auction (Q96)
total_proceedsu64Total quote tokens swept from CCA vault
total_tokens_clearedu64Total base tokens cleared in auction
raydium_poolPubkeyRaydium pool state account
auction_escrowPubkeyToken-2022 escrow for auction tokens
lp_escrowPubkeyToken-2022 escrow for LP tokens
team_escrowPubkeyToken-2022 escrow for team tokens
proceeds_escrowPubkeySPL Token escrow for quote proceeds
fee_escrowPubkeySystem account for Raydium pool creation fee
created_ati64Unix timestamp of creation
finalized_ati64Unix timestamp of finalization
settled_ati64Unix timestamp of settlement
finalized_slotu64Slot at finalization (for emergency timeout)
supply_steps_hash[u8; 32]SHA-256 hash of supply steps
bumpu8PDA bump seed
info

Protocol parameters (protocol_fee_bps, raydium_cpmm_program, cca_program, etc.) are snapshot-copied from ProtocolConfig at launch creation time. Changing protocol config does not retroactively affect existing launches.


PDA Seeds

PDASeedsProgram
ProtocolConfig["cca_protocol"]Launchpad
LaunchConfig["cca_launch", creator, launchId LE]Launchpad
TokenMint["cca_token_mint", launchConfig]Launchpad
MintAuthority["cca_mint_auth", launchConfig]Launchpad
EscrowAuthority["cca_launch_auth", launchConfig]Launchpad
AuctionEscrow["escrow", launchConfig, "auction"]Launchpad
LpEscrow["escrow", launchConfig, "lp"]Launchpad
TeamEscrow["escrow", launchConfig, "team"]Launchpad
ProceedsEscrow["escrow", launchConfig, "proceeds"]Launchpad
FeeEscrow["escrow", launchConfig, "fee"]Launchpad

Instructions (16 total)

Admin Instructions (6)

initialize_protocol

Initializes the global protocol configuration. Can only be called once.

PropertyValue
Access ControlAny signer (first caller becomes admin)
StateCreates ProtocolConfig

update_protocol_config

Updates all protocol configuration fields. Same arguments as initialize_protocol.

PropertyValue
Access ControlAdmin only (has_one = admin)

transfer_admin

Initiates 2-step admin transfer by setting pending_admin.

PropertyValue
Access ControlAdmin only
Argumentnew_admin: Pubkey

accept_admin

Completes the 2-step admin transfer. The pending admin signs to accept.

PropertyValue
Access ControlPending admin only

set_pause

Pauses or unpauses new launch creation.

PropertyValue
Access ControlAdmin only
Argumentpaused: bool

set_settlement_pause

Pauses or unpauses the settlement pipeline.

PropertyValue
Access ControlAdmin only
Argumentpaused: bool

Launch Creation Instructions (3)

create_launch_step_1

Creates the LaunchConfig account and Token-2022 mint with MetadataPointer extension.

PropertyValue
Access ControlAny signer (becomes creator)
State BeforeNone
State AfterCreated
CPI CallsToken-2022: create account, initialize metadata pointer, initialize mint, initialize metadata

Key Accounts: creator, protocol_config, launch_config (init), token_mint, mint_authority.

Arguments: launch_id, name, symbol, uri, decimals, total_supply, auction_bps, lp_bps, team_bps, lp_proceeds_bps, quote_mint, auction_duration_slots, floor_price, max_bid_price, tick_spacing, auction_block_interval, min_bid_amount, min_new_tick_amount, max_ticks, required_currency_raised, supply_steps.

Validations: Protocol not paused, auction_bps + lp_bps + team_bps == 10000, quote_mint in whitelist, all BPS within protocol ranges.

create_launch_step_2

Creates 5 escrow accounts and mints tokens to the 3 Token-2022 escrows.

PropertyValue
Access ControlCreator only
State BeforeCreated
State AfterEscrowsInitialized
CPI CallsToken-2022: create PDA token accounts (x4), mint_to (x3); System: create_account (fee escrow)

Token Distribution:

  • auction_escrow: total_supply * auction_bps / 10000
  • lp_escrow: total_supply * lp_bps / 10000
  • team_escrow: remainder (avoids rounding loss)
  • fee_escrow: 0.15 SOL (Raydium pool creation fee) from creator

initialize_cca_auction

Creates the CCA V2 auction via CPI (5 CPI calls) and transfers auction tokens to CCA vault.

PropertyValue
Access ControlCreator only
State BeforeEscrowsInitialized
State AfterAuctionReady
CPI CallsCCA V2: initialize_auction, initialize_vaults, initialize_quote_vault, initialize_floor_tick, receive_tokens

Arguments: auction_id, start_slot, end_slot, claim_slot, supply_steps (must match hash from step 1).

caution

The CCA authority for launchpad-created auctions is the escrowAuthority PDA, NOT the creator's wallet. This is a common source of PDA derivation bugs.


Settlement Instructions (4)

All settlement instructions are permissionless (any signer can call them), enabling keeper bots.

finalize_auction

Reads CCA auction state to verify graduation and records final clearing price.

PropertyValue
State BeforeAuctionReady or AuctionActive
State AfterFinalized
Conditionslot >= end_slot and currency_raised >= required

Records final_clearing_price, total_tokens_cleared, finalized_at, finalized_slot.

sweep_to_escrow

Calls CCA V2 sweep_currency to transfer quote tokens from CCA vault to proceeds_escrow.

PropertyValue
State BeforeFinalized
State AfterProceedsSwept
CPI CallsCCA V2: sweep_currency

Sets total_proceeds from actual escrow balance (authoritative source).

create_raydium_pool

Creates a Raydium CPMM liquidity pool, burns LP tokens, and distributes proceeds.

PropertyValue
State BeforeProceedsSwept
State AfterPoolCreated
CPI CallsSPL Token transfers, Raydium CPMM: initialize, SPL Token: burn
Accounts31 total (largest instruction)

Proceeds Distribution:

total_proceeds
-> protocol_fee = total_proceeds * protocol_fee_bps / 10000 -> treasury
-> remaining = total_proceeds - protocol_fee
-> lp_proceeds = remaining * lp_proceeds_bps / 10000 -> Raydium pool
-> creator_proceeds = remaining - lp_proceeds -> creator

LP tokens are permanently burned (liquidity lock).

enable_claims

Transfers team tokens to creator, enables CCA claims, and renounces mint authority.

PropertyValue
State BeforePoolCreated
State AfterSettled
CPI CallsToken-2022: transfer (team tokens), CCA V2: set_claim_slot, Token-2022: set_authority(None)

After this instruction, no more tokens can ever be minted. Bidders can now claim their filled tokens from CCA V2.


Cancel / Emergency / Recovery (3)

cancel_launch

Cancels a launch before the auction has started. Returns all tokens and lamports to creator.

PropertyValue
Access ControlCreator only
State BeforeCreated or EscrowsInitialized
State AfterCancelled
ConditionIf auction initialized, current_slot < start_slot

emergency_withdraw

Permissionless emergency recovery after settlement stalls. Triggered after timeout.

PropertyValue
Access ControlPermissionless (keeper pattern)
State BeforeFinalized, ProceedsSwept, or PoolCreated
State AfterEmergencyWithdrawn
Conditionslot > finalized_slot + emergency_timeout_slots

The creator account is NOT a signer -- keepers can trigger on behalf of offline creators. All destination accounts are validated against launch_config.authority.

recover_failed_auction

Recovers tokens from a failed (non-graduated) auction.

PropertyValue
Access ControlPermissionless
State BeforeAuctionReady or AuctionActive
State AfterFailedRecovery
Conditionslot >= end_slot and NOT graduated
CPI CallsCCA V2: sweep_unsold_tokens

Returns all tokens to creator. Bidders recover quote currency directly from CCA V2 via exit_bid (non-graduated auctions give full refunds).


CPI Patterns

CCA V2 CPI

All CCA V2 CPI calls use manual instruction construction with raw invoke_signed. Discriminators are computed as sha256("global:<snake_case_name>")[..8].

Account discriminator note: CCA V2 uses sha256("account:AuctionConfig"), not sha256("account:CcaAuctionConfig"). The Launchpad's local struct name differs from CCA V2's actual name.

Raydium CPMM CPI

Uses raw invoke_signed to avoid stack overflow from large typed structs. Raydium requires token_0_mint.key() < token_1_mint.key() (canonical ordering by pubkey).

Token-2022 CPI

Token-2022 mints are created with MetadataPointer extension. Only MetadataPointer and TokenMetadata extensions are allowed -- all others are blocked to prevent malicious token behavior.

Error Codes

CodeNameCategory
6000ProtocolAlreadyInitializedAdmin
6001UnauthorizedAdminAdmin
6005LaunchesPausedAdmin
6006SettlementPausedAdmin
6007InvalidBpsSumLaunch
6015QuoteMintNotAllowedLaunch
6018ForbiddenTokenExtensionsLaunch
6019InvalidSettlementStateState
6023AuctionNotEndedState
6024AuctionNotGraduatedState
6035ArithmeticOverflowMath
6038MinLpProceedsNotMetAccounting
6039EmergencyTimeoutNotReachedEmergency
6043SupplyStepsHashMismatchValidation
6044AuctionGraduatedRecovery