Raydium Launchpad decoder

Decode Raydium Launchpad instructions, accounts and events in Rust with the carbon-raydium-launchpad-decoder crate.

On this page

carbon-raydium-launchpad-decoder decodes the instructions, accounts and events of the Raydium Launchpad program (LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj): 25 instructions, 5 account types, 4 events. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-raydium-launchpad-decoder 2.0.0
Installcargo add carbon-raydium-launchpad-decoder@2.0.0
Program IDLanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj (carbon_raydium_launchpad_decoder::PROGRAM_ID)
CategoryLaunchpads
Decodercarbon_raydium_launchpad_decoder::RaydiumLaunchpadDecoder
Instruction enuminstructions::RaydiumLaunchpadInstruction
Account enumaccounts::RaydiumLaunchpadAccount
Event enuminstructions::CpiEvent
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-raydium-launchpad-decoder/2.0.0
Sourcedecoders/raydium-launchpad-decoder

Other launchpad decoders: Boop, Meteora DBC, Moonshot, Pump.fun, Vertigo, Virtuals, Wavebreak. To decode several in one pipeline, see launchpad decoders.

The serde feature derives Serialize/Deserialize on every type, postgres adds tables and processors for Postgres, and graphql adds a schema for the GraphQL server.

Usage#

This program crawls recent Raydium Launchpad transactions from the public RPC and prints every decoded BuyExactIn instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-raydium-launchpad-decoder@2.0.0 carbon-rpc-transaction-crawler-datasource@2.0.0 carbon-log-metrics@2.0.0 env_logger tokio --features tokio/full
src/main.rs
use {
    carbon_core::{
        error::CarbonResult, instruction::InstructionProcessorInputType, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_raydium_launchpad_decoder::{
        instructions::RaydiumLaunchpadInstruction, RaydiumLaunchpadDecoder, PROGRAM_ID,
    },
    carbon_rpc_transaction_crawler_datasource::{ConnectionConfig, Filters, RpcTransactionCrawler},
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Fetches the program's recent transactions over JSON-RPC, newest first.
    let datasource = RpcTransactionCrawler::new(
        "https://api.mainnet-beta.solana.com".to_string(),
        PROGRAM_ID,
        ConnectionConfig::default(),
        Filters::new(None, None, None),
        None,
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .instruction(RaydiumLaunchpadDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

impl Processor<InstructionProcessorInputType<'_, RaydiumLaunchpadInstruction>> for InstructionLogger {
    async fn process(
        &mut self,
        input: &InstructionProcessorInputType<'_, RaydiumLaunchpadInstruction>,
    ) -> CarbonResult<()> {
        let signature = input.metadata.transaction_metadata.signature;
        if let RaydiumLaunchpadInstruction::BuyExactIn { data, accounts, .. } = input.decoded_instruction {
            println!("buy_exact_in {signature}: {data:?} payer={}", accounts.payer);
        }
        Ok(())
    }
}
Terminal
RUST_LOG=info cargo run

Each BuyExactIn instruction prints one line with the transaction signature and the decoded BuyExactIn data. The public endpoint rate-limits requests, so the first lines can take a while; use your own RPC URL for anything beyond a test. See stream with RPC for the crawler options.

Events published with Anchor's emit_cpi! arrive as the CpiEvent instruction. Match them with RaydiumLaunchpadInstruction::CpiEvent { data: CpiEvent::ClaimVestedEvent(event), .. } (import instructions::CpiEvent); see Events. If CpiEvent never arrives, the program logs its events with emit! instead: decode them with decode_log_events.

Decode accounts#

The transaction crawler emits transactions only. To decode accounts, use a datasource that emits account updates. This program subscribes to the program's accounts with programSubscribe on the public WebSocket endpoint and prints every decoded PoolState account as it changes. Add the datasource and the Solana RPC types it takes:

Terminal
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2
src/main.rs
use {
    carbon_core::{
        account::AccountProcessorInputType, error::CarbonResult, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_raydium_launchpad_decoder::{
        accounts::RaydiumLaunchpadAccount, RaydiumLaunchpadDecoder, PROGRAM_ID,
    },
    carbon_rpc_program_subscribe_datasource::{Filters, RpcProgramSubscribe},
    solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig, UiAccountEncoding},
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Streams every change to an account owned by the program (programSubscribe).
    let config = RpcProgramAccountsConfig {
        account_config: RpcAccountInfoConfig {
            encoding: Some(UiAccountEncoding::Base64),
            ..Default::default()
        },
        ..Default::default()
    };
    let datasource = RpcProgramSubscribe::new(
        "wss://api.mainnet-beta.solana.com".to_string(),
        Filters::new(PROGRAM_ID, Some(config)),
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .account(RaydiumLaunchpadDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

impl Processor<AccountProcessorInputType<'_, RaydiumLaunchpadAccount>> for AccountLogger {
    async fn process(
        &mut self,
        input: &AccountProcessorInputType<'_, RaydiumLaunchpadAccount>,
    ) -> CarbonResult<()> {
        if let RaydiumLaunchpadAccount::PoolState(pool_state) = &input.decoded_account.data {
            println!("pool_state {}: {pool_state:?}", input.metadata.pubkey);
        }
        Ok(())
    }
}
Terminal
RUST_LOG=info cargo run

Each update to a PoolState account prints its address and decoded fields; the program runs until you stop it. Cargo resolves solana-client to 4.2.2, the exact version the datasource pins, so both use the same RpcProgramAccountsConfig type. To load every existing account once instead of streaming changes, see load account state.

Instructions#

Variants of RaydiumLaunchpadInstruction. Each is RaydiumLaunchpadInstruction::<Variant> { program_id, data, accounts }, where data and accounts are the types listed under the variant, exported from carbon_raydium_launchpad_decoder::instructions. Discriminators are the leading bytes of the instruction data, in hex.

How an instruction decodes. The decoder returns a variant only when all of these hold; otherwise the instruction is skipped and no processor is called:

  1. The instruction's program ID is LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj.
  2. The data starts with the variant's discriminator, and the rest deserializes into its data type.
  3. The instruction has at least as many accounts as the variant requires (the "Required accounts" count under each variant).

Accounts. They are matched by position, in the order listed. An account marked optional is None only when the instruction ends before it; Anchor programs pass the program ID as a placeholder for an omitted optional account, so check for Some(PROGRAM_ID) too. Accounts after the listed ones are in accounts.remaining as AccountMetas. The decoder doesn't record whether an account signed or was writable: read that from input.raw_instruction.accounts[i].is_signer and .is_writable, which follow the same order. It doesn't check signer, writable, owner or PDA constraints either; the program enforced those when the transaction executed, so a decoded instruction from a successful transaction already satisfied them.

BuyExactIn#

From the program's IDL:

Use the given amount of quote tokens to purchase base tokens.

Arguments

  • ctx - The context of accounts
  • amount_in - Amount of quote token to purchase
  • minimum_amount_out - Minimum amount of base token to receive (slippage protection)
  • share_fee_rate - Fee rate for the share

Discriminator faea0d7bd59c13ec · data BuyExactIn · accounts BuyExactInInstructionAccounts.

FieldType
amount_inu64
minimum_amount_outu64
share_fee_rateu64

Required accounts: 15; extras go to remaining.

Fields of BuyExactInInstructionAccounts, in account order:

#FieldType
0payerPubkey
1authorityPubkey
2global_configPubkey
3platform_configPubkey
4pool_statePubkey
5user_base_tokenPubkey
6user_quote_tokenPubkey
7base_vaultPubkey
8quote_vaultPubkey
9base_token_mintPubkey
10quote_token_mintPubkey
11base_token_programPubkey
12quote_token_programPubkey
13event_authorityPubkey
14programPubkey
15…remainingVec<AccountMeta>

BuyExactOut#

From the program's IDL:

Use quote tokens to purchase the given amount of base tokens.

Arguments

  • ctx - The context of accounts
  • amount_out - Amount of base token to receive
  • maximum_amount_in - Maximum amount of quote token to purchase (slippage protection)
  • share_fee_rate - Fee rate for the share

Discriminator 18d3742869039938 · data BuyExactOut · accounts BuyExactOutInstructionAccounts.

FieldType
amount_outu64
maximum_amount_inu64
share_fee_rateu64

Required accounts: 15; extras go to remaining.

Fields of BuyExactOutInstructionAccounts, in account order:

#FieldType
0payerPubkey
1authorityPubkey
2global_configPubkey
3platform_configPubkey
4pool_statePubkey
5user_base_tokenPubkey
6user_quote_tokenPubkey
7base_vaultPubkey
8quote_vaultPubkey
9base_token_mintPubkey
10quote_token_mintPubkey
11base_token_programPubkey
12quote_token_programPubkey
13event_authorityPubkey
14programPubkey
15…remainingVec<AccountMeta>

ClaimCreatorFee#

From the program's IDL:

Claim the fee from the exclusive creator fee vault.

Arguments

  • ctx - The context of accounts

Discriminator 1a618acb84ab8dfc · data ClaimCreatorFee · accounts ClaimCreatorFeeInstructionAccounts.

No data fields.

Required accounts: 8; extras go to remaining.

Fields of ClaimCreatorFeeInstructionAccounts, in account order:

#FieldType
0creatorPubkey
1fee_vault_authorityPubkey
2creator_fee_vaultPubkey
3recipient_token_accountPubkey
4quote_mintPubkey
5token_programPubkey
6system_programPubkey
7associated_token_programPubkey
8…remainingVec<AccountMeta>

ClaimPlatformFee#

From the program's IDL:

Claim platform fee

Arguments

  • ctx - The context of accounts

Discriminator 9c27d0874ced3d48 · data ClaimPlatformFee · accounts ClaimPlatformFeeInstructionAccounts.

No data fields.

Required accounts: 10; extras go to remaining.

Fields of ClaimPlatformFeeInstructionAccounts, in account order:

#FieldType
0platform_fee_walletPubkey
1authorityPubkey
2pool_statePubkey
3platform_configPubkey
4quote_vaultPubkey
5recipient_token_accountPubkey
6quote_mintPubkey
7token_programPubkey
8system_programPubkey
9associated_token_programPubkey
10…remainingVec<AccountMeta>

ClaimPlatformFeeFromVault#

From the program's IDL:

Claim the fee from the exclusive platform fee vault.

Arguments

  • ctx - The context of accounts

Discriminator 75f1c6a8f8da501d · data ClaimPlatformFeeFromVault · accounts ClaimPlatformFeeFromVaultInstructionAccounts.

No data fields.

Required accounts: 9; extras go to remaining.

Fields of ClaimPlatformFeeFromVaultInstructionAccounts, in account order:

#FieldType
0platform_fee_walletPubkey
1fee_vault_authorityPubkey
2platform_configPubkey
3platform_fee_vaultPubkey
4recipient_token_accountPubkey
5quote_mintPubkey
6token_programPubkey
7system_programPubkey
8associated_token_programPubkey
9…remainingVec<AccountMeta>

ClaimVestedToken#

From the program's IDL:

Claim vested token

Arguments

Discriminator 3121681ebd9d4f23 · data ClaimVestedToken · accounts ClaimVestedTokenInstructionAccounts.

No data fields.

Required accounts: 10; extras go to remaining.

Fields of ClaimVestedTokenInstructionAccounts, in account order:

#FieldType
0beneficiaryPubkey
1authorityPubkey
2pool_statePubkey
3vesting_recordPubkey
4base_vaultPubkey
5user_base_tokenPubkey
6base_token_mintPubkey
7base_token_programPubkey
8system_programPubkey
9associated_token_programPubkey
10…remainingVec<AccountMeta>

ClosePlatformGlobalAccess#

From the program's IDL:

Close a platform's permission to use a global config.

Discriminator 7bb4b8816fb9bb3b · data ClosePlatformGlobalAccess · accounts ClosePlatformGlobalAccessInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of ClosePlatformGlobalAccessInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1global_configPubkey
2platform_configPubkey
3platform_global_accessPubkey
4…remainingVec<AccountMeta>

CollectFee#

From the program's IDL:

Collects accumulated fees from the pool

Arguments

  • ctx - The context of accounts

Discriminator 3cadf767045d8230 · data CollectFee · accounts CollectFeeInstructionAccounts.

No data fields.

Required accounts: 8; extras go to remaining.

Fields of CollectFeeInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1authorityPubkey
2pool_statePubkey
3global_configPubkey
4quote_vaultPubkey
5quote_mintPubkey
6recipient_token_accountPubkey
7token_programPubkey
8…remainingVec<AccountMeta>

CollectMigrateFee#

From the program's IDL:

Collects migrate fees from the pool

Arguments

  • ctx - The context of accounts

Discriminator ffba96dfeb76c9ba · data CollectMigrateFee · accounts CollectMigrateFeeInstructionAccounts.

No data fields.

Required accounts: 8; extras go to remaining.

Fields of CollectMigrateFeeInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1authorityPubkey
2pool_statePubkey
3global_configPubkey
4quote_vaultPubkey
5quote_mintPubkey
6recipient_token_accountPubkey
7token_programPubkey
8…remainingVec<AccountMeta>

CreateConfig#

From the program's IDL:

Creates a new configuration

Arguments

  • ctx - The accounts needed by instruction
  • curve_type - The type of bonding curve (0: ConstantProduct)
  • index - The index of config, there may be multiple config with the same curve type.
  • trade_fee_rate - Trade fee rate, must be less than
    RATE_DENOMINATOR_VALUE

Discriminator c9cff3724b6f2fbd · data CreateConfig · accounts CreateConfigInstructionAccounts.

FieldType
curve_typeu8
indexu16
migrate_feeu64
trade_fee_rateu64

Required accounts: 8; extras go to remaining.

Fields of CreateConfigInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1global_configPubkey
2quote_token_mintPubkey
3protocol_fee_ownerPubkey
4migrate_fee_ownerPubkey
5migrate_to_amm_walletPubkey
6migrate_to_cpswap_walletPubkey
7system_programPubkey
8…remainingVec<AccountMeta>

CreatePlatformConfig#

From the program's IDL:

Create platform config account

Arguments

  • ctx - The context of accounts

Fields

  • fee_rate - Fee rate of the platform
  • name - Name of the platform
  • web - Website of the platform
  • img - Image link of the platform

Discriminator b05ac4affd71dc14 · data CreatePlatformConfig · accounts CreatePlatformConfigInstructionAccounts.

FieldType
platform_paramsPlatformParams

Required accounts: 8; extras go to remaining.

Fields of CreatePlatformConfigInstructionAccounts, in account order:

#FieldType
0platform_adminPubkey
1platform_fee_walletPubkey
2platform_nft_walletPubkey
3platform_configPubkey
4cpswap_configPubkey
5system_programPubkey
6transfer_fee_extension_authorityPubkey
7platform_vesting_walletPubkey
8…remainingVec<AccountMeta>

CreatePlatformGlobalAccess#

From the program's IDL:

Create a platform permission to use a global config when authorization is enabled.

Discriminator a25b92c75d85eaed · data CreatePlatformGlobalAccess · accounts CreatePlatformGlobalAccessInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of CreatePlatformGlobalAccessInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1global_configPubkey
2platform_configPubkey
3platform_global_accessPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

CreatePlatformVestingAccount#

From the program's IDL:

Create vesting account

Arguments

  • ctx - The context of accounts
  • share - The share amount of base token to be vested

Discriminator 9247ad4562130f6a · data CreatePlatformVestingAccount · accounts CreatePlatformVestingAccountInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of CreatePlatformVestingAccountInstructionAccounts, in account order:

#FieldType
0platform_vesting_walletPubkey
1beneficiaryPubkey
2platform_configPubkey
3pool_statePubkey
4platform_vesting_recordPubkey
5system_programPubkey
6…remainingVec<AccountMeta>

CreateVestingAccount#

From the program's IDL:

Create vesting account

Arguments

  • ctx - The context of accounts
  • share - The share amount of base token to be vested

Discriminator 81b2020dd9ace6da · data CreateVestingAccount · accounts CreateVestingAccountInstructionAccounts.

FieldType
share_amountu64

Required accounts: 5; extras go to remaining.

Fields of CreateVestingAccountInstructionAccounts, in account order:

#FieldType
0creatorPubkey
1beneficiaryPubkey
2pool_statePubkey
3vesting_recordPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

Initialize#

From the program's IDL:

Initializes a new trading pool

Arguments

  • ctx - The context of accounts containing pool and token information

Discriminator afaf6d1f0d989bed · data Initialize · accounts InitializeInstructionAccounts.

FieldType
base_mint_paramMintParams
curve_paramCurveParams
vesting_paramVestingParams

Required accounts: 18; extras go to remaining.

Fields of InitializeInstructionAccounts, in account order:

#FieldType
0payerPubkey
1creatorPubkey
2global_configPubkey
3platform_configPubkey
4authorityPubkey
5pool_statePubkey
6base_mintPubkey
7quote_mintPubkey
8base_vaultPubkey
9quote_vaultPubkey
10metadata_accountPubkey
11base_token_programPubkey
12quote_token_programPubkey
13metadata_programPubkey
14system_programPubkey
15rent_programPubkey
16event_authorityPubkey
17programPubkey
18…remainingVec<AccountMeta>

InitializeV2#

From the program's IDL:

Initializes a new trading pool

Arguments

  • ctx - The context of accounts containing pool and token information

Discriminator 4399af27da102620 · data InitializeV2 · accounts InitializeV2InstructionAccounts.

FieldType
base_mint_paramMintParams
curve_paramCurveParams
vesting_paramVestingParams
amm_fee_onAmmCreatorFeeOn

Required accounts: 18; extras go to remaining.

Fields of InitializeV2InstructionAccounts, in account order:

#FieldType
0payerPubkey
1creatorPubkey
2global_configPubkey
3platform_configPubkey
4authorityPubkey
5pool_statePubkey
6base_mintPubkey
7quote_mintPubkey
8base_vaultPubkey
9quote_vaultPubkey
10metadata_accountPubkey
11base_token_programPubkey
12quote_token_programPubkey
13metadata_programPubkey
14system_programPubkey
15rent_programPubkey
16event_authorityPubkey
17programPubkey
18…remainingVec<AccountMeta>

InitializeWithToken2022#

From the program's IDL:

Initializes a new trading pool with base token belongs to spl-token-2022, pool created by this instruction must be migrated to cpswap after fundraising ends, i.e., curve_param.migrate_type = 1 # Arguments

  • ctx - The context of accounts containing pool and token information

Discriminator 25be7ede2c9aab11 · data InitializeWithToken2022 · accounts InitializeWithToken2022InstructionAccounts.

FieldType
base_mint_paramMintParams
curve_paramCurveParams
vesting_paramVestingParams
amm_fee_onAmmCreatorFeeOn
transfer_fee_extension_paramOption<TransferFeeExtensionParams>

Required accounts: 15; extras go to remaining.

Fields of InitializeWithToken2022InstructionAccounts, in account order:

#FieldType
0payerPubkey
1creatorPubkey
2global_configPubkey
3platform_configPubkey
4authorityPubkey
5pool_statePubkey
6base_mintPubkey
7quote_mintPubkey
8base_vaultPubkey
9quote_vaultPubkey
10base_token_programPubkey
11quote_token_programPubkey
12system_programPubkey
13event_authorityPubkey
14programPubkey
15…remainingVec<AccountMeta>

MigrateToAmm#

From the program's IDL:

Arguments

  • ctx - The context of accounts

Discriminator cf52c091fecf91df · data MigrateToAmm · accounts MigrateToAmmInstructionAccounts.

FieldType
base_lot_sizeu64
quote_lot_sizeu64
market_vault_signer_nonceu8

Required accounts: 32; extras go to remaining.

Fields of MigrateToAmmInstructionAccounts, in account order:

#FieldType
0payerPubkey
1base_mintPubkey
2quote_mintPubkey
3openbook_programPubkey
4marketPubkey
5request_queuePubkey
6event_queuePubkey
7bidsPubkey
8asksPubkey
9market_vault_signerPubkey
10market_base_vaultPubkey
11market_quote_vaultPubkey
12amm_programPubkey
13amm_poolPubkey
14amm_authorityPubkey
15amm_open_ordersPubkey
16amm_lp_mintPubkey
17amm_base_vaultPubkey
18amm_quote_vaultPubkey
19amm_target_ordersPubkey
20amm_configPubkey
21amm_create_fee_destinationPubkey
22authorityPubkey
23pool_statePubkey
24global_configPubkey
25base_vaultPubkey
26quote_vaultPubkey
27pool_lp_tokenPubkey
28spl_token_programPubkey
29associated_token_programPubkey
30system_programPubkey
31rent_programPubkey
32…remainingVec<AccountMeta>

MigrateToCpswap#

From the program's IDL:

Arguments

  • ctx - The context of accounts

Discriminator 885cc8671cda908c · data MigrateToCpswap · accounts MigrateToCpswapInstructionAccounts.

No data fields.

Required accounts: 28; extras go to remaining.

Fields of MigrateToCpswapInstructionAccounts, in account order:

#FieldType
0payerPubkey
1base_mintPubkey
2quote_mintPubkey
3platform_configPubkey
4cpswap_programPubkey
5cpswap_poolPubkey
6cpswap_authorityPubkey
7cpswap_lp_mintPubkey
8cpswap_base_vaultPubkey
9cpswap_quote_vaultPubkey
10cpswap_configPubkey
11cpswap_create_pool_feePubkey
12cpswap_observationPubkey
13lock_programPubkey
14lock_authorityPubkey
15lock_lp_vaultPubkey
16authorityPubkey
17pool_statePubkey
18global_configPubkey
19base_vaultPubkey
20quote_vaultPubkey
21pool_lp_tokenPubkey
22base_token_programPubkey
23quote_token_programPubkey
24associated_token_programPubkey
25system_programPubkey
26rent_programPubkey
27metadata_programPubkey
28…remainingVec<AccountMeta>

RemovePlatformCurveParam#

From the program's IDL:

Remove platform launch param

Arguments

  • ctx - The context of accounts
  • index - The index of the curve param to remove

Discriminator 1b1e3ea95de01891 · data RemovePlatformCurveParam · accounts RemovePlatformCurveParamInstructionAccounts.

FieldType
indexu8

Required accounts: 2; extras go to remaining.

Fields of RemovePlatformCurveParamInstructionAccounts, in account order:

#FieldType
0platform_adminPubkey
1platform_configPubkey
2…remainingVec<AccountMeta>

SellExactIn#

From the program's IDL:

Use the given amount of base tokens to sell for quote tokens.

Arguments

  • ctx - The context of accounts
  • amount_in - Amount of base token to sell
  • minimum_amount_out - Minimum amount of quote token to receive (slippage protection)
  • share_fee_rate - Fee rate for the share

Discriminator 9527de9bd37c981a · data SellExactIn · accounts SellExactInInstructionAccounts.

FieldType
amount_inu64
minimum_amount_outu64
share_fee_rateu64

Required accounts: 15; extras go to remaining.

Fields of SellExactInInstructionAccounts, in account order:

#FieldType
0payerPubkey
1authorityPubkey
2global_configPubkey
3platform_configPubkey
4pool_statePubkey
5user_base_tokenPubkey
6user_quote_tokenPubkey
7base_vaultPubkey
8quote_vaultPubkey
9base_token_mintPubkey
10quote_token_mintPubkey
11base_token_programPubkey
12quote_token_programPubkey
13event_authorityPubkey
14programPubkey
15…remainingVec<AccountMeta>

SellExactOut#

From the program's IDL:

Sell base tokens for the given amount of quote tokens.

Arguments

  • ctx - The context of accounts
  • amount_out - Amount of quote token to receive
  • maximum_amount_in - Maximum amount of base token to purchase (slippage protection)
  • share_fee_rate - Fee rate for the share

Discriminator 5fc8472208090ba6 · data SellExactOut · accounts SellExactOutInstructionAccounts.

FieldType
amount_outu64
maximum_amount_inu64
share_fee_rateu64

Required accounts: 15; extras go to remaining.

Fields of SellExactOutInstructionAccounts, in account order:

#FieldType
0payerPubkey
1authorityPubkey
2global_configPubkey
3platform_configPubkey
4pool_statePubkey
5user_base_tokenPubkey
6user_quote_tokenPubkey
7base_vaultPubkey
8quote_vaultPubkey
9base_token_mintPubkey
10quote_token_mintPubkey
11base_token_programPubkey
12quote_token_programPubkey
13event_authorityPubkey
14programPubkey
15…remainingVec<AccountMeta>

UpdateConfig#

From the program's IDL:

Updates configuration parameters

Arguments

  • ctx - The context of accounts
  • param - Parameter to update:
  • 0: Update trade_fee_rate
  • 1: Update fee owner
  • 12: Toggle whether explicit platform authorization is required
  • value - New value for the selected parameter

Discriminator 1d9efcbf0a53db63 · data UpdateConfig · accounts UpdateConfigInstructionAccounts.

FieldType
paramu8
valueu64

Required accounts: 2; extras go to remaining.

Fields of UpdateConfigInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1global_configPubkey
2…remainingVec<AccountMeta>

UpdatePlatformConfig#

From the program's IDL:

Update platform config

Arguments

  • ctx - The context of accounts
  • param - Parameter to update

Discriminator c33c4c81922d438f · data UpdatePlatformConfig · accounts UpdatePlatformConfigInstructionAccounts.

FieldType
paramPlatformConfigParam

Required accounts: 2; extras go to remaining.

Fields of UpdatePlatformConfigInstructionAccounts, in account order:

#FieldType
0platform_adminPubkey
1platform_configPubkey
2…remainingVec<AccountMeta>

UpdatePlatformCurveParam#

From the program's IDL:

Update platform launch param

Arguments

  • ctx - The context of accounts
  • bonding_curve_param - Parameter to update

Discriminator 8a908afadc800439 · data UpdatePlatformCurveParam · accounts UpdatePlatformCurveParamInstructionAccounts.

FieldType
indexu8
bonding_curve_paramBondingCurveParam

Required accounts: 4; extras go to remaining.

Fields of UpdatePlatformCurveParamInstructionAccounts, in account order:

#FieldType
0platform_adminPubkey
1platform_configPubkey
2global_configPubkey
3system_programPubkey
4…remainingVec<AccountMeta>

CpiEvent#

Anchor self-CPI that carries one of the program's events. data is the CpiEvent enum.

Discriminator e445a52e51cb9a1d · data CpiEvent · accounts CpiEventInstructionAccounts.

Required accounts: 2; extras go to remaining.

Fields of CpiEventInstructionAccounts, in account order:

#FieldType
0programPubkey
1event_authorityPubkey
2…remainingVec<AccountMeta>

Accounts#

Variants of RaydiumLaunchpadAccount. Each wraps a boxed struct from carbon_raydium_launchpad_decoder::accounts::<module>. decode_account only considers accounts owned by PROGRAM_ID and returns the first variant that matches.

GlobalConfig#

Discriminator 95089ccaa0fcb0d9 · accounts::global_config::GlobalConfig.

FieldTypeDescription
epochu64Account update epoch
curve_typeu80: Constant Product Curve 1: Fixed Price Curve 2: Linear Price Curve
indexu16Config index
migrate_feeu64The fee of migrate to amm
trade_fee_rateu64The trade fee rate, denominated in hundredths of a bip (10^-6)
max_share_fee_rateu64The maximum share fee rate, denominated in hundredths of a bip (10^-6)
min_base_supplyu64The minimum base supply, the value without decimals
max_lock_rateu64The maximum lock rate, denominated in hundredths of a bip (10^-6)
min_base_sell_rateu64The minimum base sell rate, denominated in hundredths of a bip (10^-6)
min_base_migrate_rateu64The minimum base migrate rate, denominated in hundredths of a bip (10^-6)
min_quote_fund_raisingu64The minimum quote fund raising, the value with decimals
quote_mintPubkeyMint information for quote token
protocol_fee_ownerPubkeyProtocol Fee owner
migrate_fee_ownerPubkeyMigrate Fee owner
migrate_to_amm_walletPubkeyMigrate to amm control wallet
migrate_to_cpswap_walletPubkeyMigrate to cpswap wallet
requires_platform_authu8Whether a platform must be explicitly authorized before using this global config
padding_alignment[u8; 7]padding alignment
padding[u64; 15]padding for future updates

PlatformConfig#

Discriminator a04e8000f853e6a0 · accounts::platform_config::PlatformConfig.

FieldTypeDescription
epochu64The epoch for update interval
platform_fee_walletPubkeyThe platform fee wallet
platform_nft_walletPubkeyThe platform nft wallet to receive the platform NFT after migration if platform_scale is not 0(Only support MigrateType::CPSWAP)
platform_scaleu64Scale of the platform liquidity quantity rights will be converted into NFT(Only support MigrateType::CPSWAP)
creator_scaleu64Scale of the token creator liquidity quantity rights will be converted into NFT(Only support MigrateType::CPSWAP)
burn_scaleu64Scale of liquidity directly to burn
fee_rateu64The platform fee rate
name[u8; 64]The platform name
web[u8; 256]The platform website
img[u8; 256]The platform img link
cpswap_configPubkeyThe platform specifies the trade fee rate after migration to cp swap
creator_fee_rateu64Creator fee rate
transfer_fee_extension_authPubkeyIf the base token belongs to token2022, then you can choose to support the transferfeeConfig extension, which includes permissions such as transfer_fee_config_authority and withdraw_withheld_authority. When initializing mint, withdraw_withheld_authority and transfer_fee_config_authority both belongs to the contract. Once the token is migrated to AMM, the authorities will be reset to this value
platform_vesting_walletPubkey
platform_vesting_scaleu64
platform_cp_creatorPubkeyIf a valid platform_cp_creator is configured for the platform, it will be used as the creator for the AMM pool during migration to cpswap pool.
padding[u8; 108]padding for future updates
curve_paramsVec<PlatformCurveParam>The parameters for launching the pool

PlatformGlobalAccess#

Discriminator ae9384f089dbf310 · accounts::platform_global_access::PlatformGlobalAccess.

FieldTypeDescription
bumpu8
global_configPubkey
platform_configPubkey
padding[u64; 8]padding for future updates

PoolState#

Discriminator f7ede3f5d7c3de46 · accounts::pool_state::PoolState.

FieldTypeDescription
epochu64Account update epoch
auth_bumpu8Bump seed used for PDA address derivation
statusu8Current status of the pool * 0: Pool is funding * 1: Pool funding is end, waiting for migration * 2: Pool migration is done
base_decimalsu8Decimals of the pool base token
quote_decimalsu8Decimals of the pool quote token
migrate_typeu8Migrate to AMM or CpSwap, 0: amm, 1: cpswap
supplyu64Supply of the pool base token
total_base_sellu64Total sell amount of the base token
virtual_baseu64For different curves, virtual_base and virtual_quote have different meanings For constant product curve, virtual_base and virtual_quote are virtual liquidity, virtual_quote/virtual_base is the initial price For linear price curve, virtual_base is the price slope parameter a, virtual_quote has no effect For fixed price curve, virtual_quote/virtual_base is the initial price
virtual_quoteu64
real_baseu64Actual base token amount in the pool Represents the real tokens available for trading
real_quoteu64Actual quote token amount in the pool Represents the real tokens available for trading
total_quote_fund_raisingu64The total quote fund raising of the pool
quote_protocol_feeu64Accumulated trading fees in quote tokens Can be collected by the protocol fee owner
platform_feeu64Accumulated platform fees in quote tokens Can be collected by the platform wallet stored in platform config
migrate_feeu64The fee of migrate to amm
vesting_scheduleVestingScheduleVesting schedule for the base token
global_configPubkeyPublic key of the global configuration account Contains protocol-wide settings this pool adheres to
platform_configPubkeyPublic key of the platform configuration account Contains platform-wide settings this pool adheres to
base_mintPubkeyPublic key of the base mint address
quote_mintPubkeyPublic key of the quote mint address
base_vaultPubkeyPublic key of the base token vault Holds the actual base tokens owned by the pool
quote_vaultPubkeyPublic key of the quote token vault Holds the actual quote tokens owned by the pool
creatorPubkeyThe creator of base token
token_program_flagu8token program bits bit0: base token program flag 0: spl_token_program 1: token_program_2022 bit1: quote token program flag 0: spl_token_program 1: token_program_2022
amm_creator_fee_onAmmCreatorFeeOnmigrate to cpmm, creator fee on quote token or both token
platform_vesting_shareu64platform vesting token amount
padding[u8; 54]padding for future updates

VestingRecord#

Discriminator 6af3ddcde67e5553 · accounts::vesting_record::VestingRecord.

FieldTypeDescription
epochu64Account update epoch
poolPubkeyThe pool state account
beneficiaryPubkeyThe beneficiary of the vesting account
claimed_amountu64The amount of tokens claimed
token_share_amountu64The share amount of the token to be vested
padding[u64; 8]padding for future updates

Events#

Variants of instructions::CpiEvent, decoded from the CpiEvent instruction. Each wraps a struct from carbon_raydium_launchpad_decoder::events::<module>. The discriminator is the 8-byte event discriminator that follows the e445a52e51cb9a1d CPI-event tag.

ClaimVestedEvent#

Discriminator 15c2725778d3e220 · events::claim_vested_event::ClaimVestedEventEvent.

FieldType
pool_statePubkey
beneficiaryPubkey
claim_amountu64

CreateVestingEvent#

Discriminator 96980bb334d2bf7d · events::create_vesting_event::CreateVestingEventEvent.

FieldType
pool_statePubkey
beneficiaryPubkey
share_amountu64

PoolCreateEvent#

Discriminator 97d7e20976a173ae · events::pool_create_event::PoolCreateEventEvent.

FieldType
pool_statePubkey
creatorPubkey
configPubkey
base_mint_paramMintParams
curve_paramCurveParams
vesting_paramVestingParams
amm_fee_onAmmCreatorFeeOn

TradeEvent#

Discriminator bddb7fd34ee661ee · events::trade_event::TradeEventEvent.

FieldType
pool_statePubkey
total_base_sellu64
virtual_baseu64
virtual_quoteu64
real_base_beforeu64
real_quote_beforeu64
real_base_afteru64
real_quote_afteru64
amount_inu64
amount_outu64
protocol_feeu64
platform_feeu64
creator_feeu64
share_feeu64
trade_directionTradeDirection
pool_statusPoolStatus
exact_inbool

Types#

Types used by the instructions, accounts and events above, exported from carbon_raydium_launchpad_decoder::types.

AmmCreatorFeeOn#

From the program's IDL:

migrate to cpmm, creator fee on quote token or both token

Enum types::AmmCreatorFeeOn.

Variant
QuoteToken
BothToken

BondingCurveParam#

Struct types::BondingCurveParam.

FieldTypeDescription
migrate_typeu8Migrate to AMM or CpSwap, 0: amm, 1: cpswap, Neither 0 nor 1: invalid
migrate_cpmm_fee_onu8The migrate fee on, 0 means fee on the quote token, 1 means fee on both token Neither 0 nor 1: invalid
supplyu64The supply of the token, 0: invalid
total_base_sellu64The total base sell of the token 0: invalid
total_quote_fund_raisingu64The total quote fund raising of the token 0: invalid
total_locked_amountu64total amount of tokens to be unlocked u64::MAX: invalid
cliff_periodu64Waiting time in seconds before unlocking after fundraising ends u64::MAX: invalid
unlock_periodu64Unlocking period in seconds u64::MAX: invalid

ClaimVestedEvent#

From the program's IDL:

Emitted when vesting token claimed by beneficiary

Struct types::ClaimVestedEvent. Same fields as the ClaimVestedEvent event.

ConstantCurve#

Struct types::ConstantCurve.

FieldType
supplyu64
total_base_sellu64
total_quote_fund_raisingu64
migrate_typeu8

CreateVestingEvent#

From the program's IDL:

Emitted when vest_account created

Struct types::CreateVestingEvent. Same fields as the CreateVestingEvent event.

CurveParams#

Enum types::CurveParams.

VariantFields
Constantdata: ConstantCurve
Fixeddata: FixedCurve
Lineardata: LinearCurve

FixedCurve#

Struct types::FixedCurve.

FieldType
supplyu64
total_quote_fund_raisingu64
migrate_typeu8

LinearCurve#

Struct types::LinearCurve.

FieldType
supplyu64
total_quote_fund_raisingu64
migrate_typeu8

MigrateNftInfo#

From the program's IDL:

Represents the parameters for initializing a platform config account(Only support MigrateType::CPSWAP) # Fields

  • platform_scale - Scale of the platform liquidity quantity rights will be converted into NFT
  • creator_scale - Scale of the token creator liquidity quantity rights will be converted into NFT
  • burn_scale - Scale of liquidity directly to burn
  • platform_scale + creator_scale + burn_scale = RATE_DENOMINATOR_VALUE

Struct types::MigrateNftInfo.

FieldType
platform_scaleu64
creator_scaleu64
burn_scaleu64

MintParams#

From the program's IDL:

Represents the parameters for initializing a new token mint

Fields

  • decimals - Number of decimal places for the token
  • name - Name of the token
  • symbol - Symbol/ticker of the token
  • uri - URI pointing to token metadata

Struct types::MintParams.

FieldType
decimalsu8
nameString
symbolString
uriString

PlatformConfigInfo#

Struct types::PlatformConfigInfo.

FieldType
fee_walletPubkey
nft_walletPubkey
migrate_nft_infoMigrateNftInfo
fee_rateu64
nameString
webString
imgString
transfer_fee_extension_authPubkey
creator_fee_rateu64
platform_vesting_scaleu64
vesting_walletPubkey

PlatformConfigParam#

Enum types::PlatformConfigParam.

VariantFields
FeeWalletPubkey
NFTWalletPubkey
MigrateNftInfoMigrateNftInfo
FeeRateu64
NameString
WebString
ImgString
CpSwapConfig
AllInfoPlatformConfigInfo
VestingWalletPubkey
PlatformVestingScaleu64
PlatformCPCreatorPubkey

PlatformCurveParam#

Struct types::PlatformCurveParam.

FieldTypeDescription
epochu64The epoch for update interval, 0 means not update
indexu8The curve params index
global_configPubkeyThe global config address
bonding_curve_paramBondingCurveParambonding curve param
padding[u64; 50]padding for future updates

PlatformParams#

From the program's IDL:

Represents the parameters for initializing a platform config account

Fields

  • migrate_nft_info - The platform configures liquidity info during migration(Only support MigrateType::CPSWAP)
  • fee_rate - Fee rate of the platform
  • name - Name of the platform
  • web - Website of the platform
  • img - Image link of the platform

/// * creator_fee_rate - The fee rate charged by the creator for each transaction.

Struct types::PlatformParams.

FieldType
migrate_nft_infoMigrateNftInfo
fee_rateu64
nameString
webString
imgString
creator_fee_rateu64
platform_vesting_scaleu64

PoolCreateEvent#

From the program's IDL:

Emitted when pool created

Struct types::PoolCreateEvent. Same fields as the PoolCreateEvent event.

PoolStatus#

From the program's IDL:

Represents the different states a pool can be in

  • Fund - Initial state where pool is accepting funds
  • Migrate - Pool funding has ended and waiting for migration
  • Trade - Pool migration is complete and amm trading is enabled

Enum types::PoolStatus.

Variant
Fund
Migrate
Trade

TradeDirection#

From the program's IDL:

Specifies the direction of a trade in the bonding curve
This is important because curves can treat tokens differently through weights or offsets

Enum types::TradeDirection.

Variant
Buy
Sell

TradeEvent#

From the program's IDL:

Emitted when trade process

Struct types::TradeEvent. Same fields as the TradeEvent event.

TransferFeeExtensionParams#

Struct types::TransferFeeExtensionParams.

FieldTypeDescription
transfer_fee_basis_pointsu16denominator is 10000, currently, this value cannot exceed 5%, which is 500.
maximum_feeu64Maximum fee on each transfers, the value must exceed supply * transfer_fee_basis_points / 10000

VestingParams#

Struct types::VestingParams.

FieldType
total_locked_amountu64
cliff_periodu64
unlock_periodu64

VestingSchedule#

Struct types::VestingSchedule.

FieldTypeDescription
total_locked_amountu64
cliff_periodu64
unlock_periodu64
start_timeu64
allocated_share_amountu64Total allocated share amount of the base token, not greater than total_locked_amount

Generated from the crate’s source at Carbon v2.0.0, so it always matches the published code. Spotted a problem? Report it; edits to this page itself are overwritten on the next release.

Your endpoints

Code samples use these instead of the placeholders, so you can copy and run them as they are. They’re stored only in this browser and never sent anywhere.