PumpSwap decoder

Decode PumpSwap instructions, accounts and events in Rust with carbon-pump-swap-decoder 2.0.0. Program ID pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA.

On this page

carbon-pump-swap-decoder decodes the instructions, accounts and events of the PumpSwap program (pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA): 25 instructions, 7 account types, 22 events. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-pump-swap-decoder 2.0.0
Installcargo add carbon-pump-swap-decoder@2.0.0
Program IDpAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA (carbon_pump_swap_decoder::PROGRAM_ID)
CategoryDEX & AMM
Decodercarbon_pump_swap_decoder::PumpSwapDecoder
Instruction enuminstructions::PumpSwapInstruction
Account enumaccounts::PumpSwapAccount
Event enuminstructions::CpiEvent
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-pump-swap-decoder/2.0.0
Sourcedecoders/pump-swap-decoder

Other DEX and AMM decoders: BonkSwap, FluxBeam, Gavel, Heaven, Jupiter Limit Order, Jupiter Limit Order v2, Kamino Limit Order, Lifinity AMM v2, Meteora DAMM v2, Meteora DLMM, Meteora Pools, OpenBook v2, Orca Whirlpools, PancakeSwap, Phoenix v1, Raydium AMM v4, Raydium CLMM, Raydium CPMM, Raydium Stable Swap, Stabble Stable Swap, Stabble Weighted Swap. To decode several in one pipeline, see dEX and AMM decoders.

Guide: Index swaps across DEXs.

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 PumpSwap transactions from the public RPC and prints every decoded Buy instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-pump-swap-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_pump_swap_decoder::{instructions::PumpSwapInstruction, PumpSwapDecoder, 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(PumpSwapDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

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

Each Buy instruction prints one line with the transaction signature and the decoded Buy 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 PumpSwapInstruction::CpiEvent { data: CpiEvent::AdminSetCoinCreatorEvent(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 Pool 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_pump_swap_decoder::{accounts::PumpSwapAccount, PumpSwapDecoder, 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(PumpSwapDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

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

Each update to a Pool 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 PumpSwapInstruction. Each is PumpSwapInstruction::<Variant> { program_id, data, accounts }, where data and accounts are the types listed under the variant, exported from carbon_pump_swap_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 pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA.
  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.

AdminSetCoinCreator#

From the program's IDL:

Overrides the coin creator for a canonical pump pool

Discriminator f228759149606968 · data AdminSetCoinCreator · accounts AdminSetCoinCreatorInstructionAccounts.

FieldType
coin_creatorPubkey

Required accounts: 5; extras go to remaining.

Fields of AdminSetCoinCreatorInstructionAccounts, in account order:

#FieldType
0admin_set_coin_creator_authorityPubkey
1global_configPubkey
2poolPubkey
3event_authorityPubkey
4programPubkey
5…remainingVec<AccountMeta>

AdminUpdateTokenIncentives#

Discriminator d10b7357d5177ccc · data AdminUpdateTokenIncentives · accounts AdminUpdateTokenIncentivesInstructionAccounts.

FieldType
start_timei64
end_timei64
seconds_in_a_dayi64
day_numberu64
token_supply_per_dayu64

Required accounts: 10; extras go to remaining.

Fields of AdminUpdateTokenIncentivesInstructionAccounts, in account order:

#FieldType
0adminPubkey
1global_configPubkey
2global_volume_accumulatorPubkey
3mintPubkey
4global_incentive_token_accountPubkey
5associated_token_programPubkey
6system_programPubkey
7token_programPubkey
8event_authorityPubkey
9programPubkey
10…remainingVec<AccountMeta>

Buy#

From the program's IDL:

For cashback coins, optionally pass user_volume_accumulator_wsol_ata as remaining_accounts[0]. If provided and valid, the ATA will be initialized if needed.

Discriminator 66063d1201daebea · data Buy · accounts BuyInstructionAccounts.

FieldType
base_amount_outu64
max_quote_amount_inu64
track_volumeOptionBool

Required accounts: 23; extras go to remaining.

Fields of BuyInstructionAccounts, in account order:

#FieldType
0poolPubkey
1userPubkey
2global_configPubkey
3base_mintPubkey
4quote_mintPubkey
5user_base_token_accountPubkey
6user_quote_token_accountPubkey
7pool_base_token_accountPubkey
8pool_quote_token_accountPubkey
9protocol_fee_recipientPubkey
10protocol_fee_recipient_token_accountPubkey
11base_token_programPubkey
12quote_token_programPubkey
13system_programPubkey
14associated_token_programPubkey
15event_authorityPubkey
16programPubkey
17coin_creator_vault_ataPubkey
18coin_creator_vault_authorityPubkey
19global_volume_accumulatorPubkey
20user_volume_accumulatorPubkey
21fee_configPubkey
22fee_programPubkey
23…remainingVec<AccountMeta>

BuyExactQuoteIn#

From the program's IDL:

Given a budget of spendable_quote_in, buy at least min_base_amount_out
Fees will be deducted from spendable_quote_in f(quote) = tokens, where tokens >= min_base_amount_out
Make sure the payer has enough SOL to cover creation of the following accounts (unless already created):

  • protocol_fee_recipient_token_account:
    rent.minimum_balance(TokenAccount::LEN)
  • coin_creator_vault_ata: rent.minimum_balance(TokenAccount::LEN)
  • user_volume_accumulator: rent.minimum_balance(UserVolumeAccumulator::LEN)

For cashback coins, optionally pass user_volume_accumulator_wsol_ata as remaining_accounts[0]. If provided and valid, the ATA will be initialized if needed.

Discriminator c62e1552b4d9e870 · data BuyExactQuoteIn · accounts BuyExactQuoteInInstructionAccounts.

FieldType
spendable_quote_inu64
min_base_amount_outu64
track_volumeOptionBool

Required accounts: 23; extras go to remaining.

Fields of BuyExactQuoteInInstructionAccounts, in account order:

#FieldType
0poolPubkey
1userPubkey
2global_configPubkey
3base_mintPubkey
4quote_mintPubkey
5user_base_token_accountPubkey
6user_quote_token_accountPubkey
7pool_base_token_accountPubkey
8pool_quote_token_accountPubkey
9protocol_fee_recipientPubkey
10protocol_fee_recipient_token_accountPubkey
11base_token_programPubkey
12quote_token_programPubkey
13system_programPubkey
14associated_token_programPubkey
15event_authorityPubkey
16programPubkey
17coin_creator_vault_ataPubkey
18coin_creator_vault_authorityPubkey
19global_volume_accumulatorPubkey
20user_volume_accumulatorPubkey
21fee_configPubkey
22fee_programPubkey
23…remainingVec<AccountMeta>

ClaimCashback#

Discriminator 253a237ebe35e4c5 · data ClaimCashback · accounts ClaimCashbackInstructionAccounts.

No data fields.

Required accounts: 9; extras go to remaining.

Fields of ClaimCashbackInstructionAccounts, in account order:

#FieldType
0userPubkey
1user_volume_accumulatorPubkey
2quote_mintPubkey
3quote_token_programPubkey
4user_volume_accumulator_wsol_token_accountPubkey
5user_wsol_token_accountPubkey
6system_programPubkey
7event_authorityPubkey
8programPubkey
9…remainingVec<AccountMeta>

ClaimTokenIncentives#

Discriminator 1004471ccc01281b · data ClaimTokenIncentives · accounts ClaimTokenIncentivesInstructionAccounts.

No data fields.

Required accounts: 12; extras go to remaining.

Fields of ClaimTokenIncentivesInstructionAccounts, in account order:

#FieldType
0userPubkey
1user_ataPubkey
2global_volume_accumulatorPubkey
3global_incentive_token_accountPubkey
4user_volume_accumulatorPubkey
5mintPubkey
6token_programPubkey
7system_programPubkey
8associated_token_programPubkey
9event_authorityPubkey
10programPubkey
11payerPubkey
12…remainingVec<AccountMeta>

CloseUserVolumeAccumulator#

Discriminator f945a4da9667548a · data CloseUserVolumeAccumulator · accounts CloseUserVolumeAccumulatorInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of CloseUserVolumeAccumulatorInstructionAccounts, in account order:

#FieldType
0userPubkey
1user_volume_accumulatorPubkey
2event_authorityPubkey
3programPubkey
4…remainingVec<AccountMeta>

CollectCoinCreatorFee#

Discriminator a039592ab58b2b42 · data CollectCoinCreatorFee · accounts CollectCoinCreatorFeeInstructionAccounts.

No data fields.

Required accounts: 8; extras go to remaining.

Fields of CollectCoinCreatorFeeInstructionAccounts, in account order:

#FieldType
0quote_mintPubkey
1quote_token_programPubkey
2coin_creatorPubkey
3coin_creator_vault_authorityPubkey
4coin_creator_vault_ataPubkey
5coin_creator_token_accountPubkey
6event_authorityPubkey
7programPubkey
8…remainingVec<AccountMeta>

CreateConfig#

Discriminator c9cff3724b6f2fbd · data CreateConfig · accounts CreateConfigInstructionAccounts.

FieldType
lp_fee_basis_pointsu64
protocol_fee_basis_pointsu64
protocol_fee_recipients[Pubkey; 8]
coin_creator_fee_basis_pointsu64
admin_set_coin_creator_authorityPubkey

Required accounts: 5; extras go to remaining.

Fields of CreateConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1global_configPubkey
2system_programPubkey
3event_authorityPubkey
4programPubkey
5…remainingVec<AccountMeta>

CreatePool#

Discriminator e992d18ecf6840bc · data CreatePool · accounts CreatePoolInstructionAccounts.

FieldType
indexu16
base_amount_inu64
quote_amount_inu64
coin_creatorPubkey
is_mayhem_modebool
is_cashback_coinOptionBool

Required accounts: 18; extras go to remaining.

Fields of CreatePoolInstructionAccounts, in account order:

#FieldType
0poolPubkey
1global_configPubkey
2creatorPubkey
3base_mintPubkey
4quote_mintPubkey
5lp_mintPubkey
6user_base_token_accountPubkey
7user_quote_token_accountPubkey
8user_pool_token_accountPubkey
9pool_base_token_accountPubkey
10pool_quote_token_accountPubkey
11system_programPubkey
12token2022_programPubkey
13base_token_programPubkey
14quote_token_programPubkey
15associated_token_programPubkey
16event_authorityPubkey
17programPubkey
18…remainingVec<AccountMeta>

Deposit#

Discriminator f223c68952e1f2b6 · data Deposit · accounts DepositInstructionAccounts.

FieldType
lp_token_amount_outu64
max_base_amount_inu64
max_quote_amount_inu64

Required accounts: 15; extras go to remaining.

Fields of DepositInstructionAccounts, in account order:

#FieldType
0poolPubkey
1global_configPubkey
2userPubkey
3base_mintPubkey
4quote_mintPubkey
5lp_mintPubkey
6user_base_token_accountPubkey
7user_quote_token_accountPubkey
8user_pool_token_accountPubkey
9pool_base_token_accountPubkey
10pool_quote_token_accountPubkey
11token_programPubkey
12token2022_programPubkey
13event_authorityPubkey
14programPubkey
15…remainingVec<AccountMeta>

Disable#

Discriminator b9adbb5ad80feee9 · data Disable · accounts DisableInstructionAccounts.

FieldType
disable_create_poolbool
disable_depositbool
disable_withdrawbool
disable_buybool
disable_sellbool

Required accounts: 4; extras go to remaining.

Fields of DisableInstructionAccounts, in account order:

#FieldType
0adminPubkey
1global_configPubkey
2event_authorityPubkey
3programPubkey
4…remainingVec<AccountMeta>

ExtendAccount#

Discriminator ea66c2cb96483ee5 · data ExtendAccount · accounts ExtendAccountInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of ExtendAccountInstructionAccounts, in account order:

#FieldType
0accountPubkey
1userPubkey
2system_programPubkey
3event_authorityPubkey
4programPubkey
5…remainingVec<AccountMeta>

InitUserVolumeAccumulator#

Discriminator 5e06ca73ff60e8b7 · data InitUserVolumeAccumulator · accounts InitUserVolumeAccumulatorInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of InitUserVolumeAccumulatorInstructionAccounts, in account order:

#FieldType
0payerPubkey
1userPubkey
2user_volume_accumulatorPubkey
3system_programPubkey
4event_authorityPubkey
5programPubkey
6…remainingVec<AccountMeta>

MigratePoolCoinCreator#

From the program's IDL:

Migrate Pool Coin Creator to Sharing Config

Discriminator d0089f044aaf103a · data MigratePoolCoinCreator · accounts MigratePoolCoinCreatorInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of MigratePoolCoinCreatorInstructionAccounts, in account order:

#FieldType
0poolPubkey
1sharing_configPubkey
2event_authorityPubkey
3programPubkey
4…remainingVec<AccountMeta>

Sell#

Discriminator 33e685a4017f83ad · data Sell · accounts SellInstructionAccounts.

FieldType
base_amount_inu64
min_quote_amount_outu64

Required accounts: 21; extras go to remaining.

Fields of SellInstructionAccounts, in account order:

#FieldType
0poolPubkey
1userPubkey
2global_configPubkey
3base_mintPubkey
4quote_mintPubkey
5user_base_token_accountPubkey
6user_quote_token_accountPubkey
7pool_base_token_accountPubkey
8pool_quote_token_accountPubkey
9protocol_fee_recipientPubkey
10protocol_fee_recipient_token_accountPubkey
11base_token_programPubkey
12quote_token_programPubkey
13system_programPubkey
14associated_token_programPubkey
15event_authorityPubkey
16programPubkey
17coin_creator_vault_ataPubkey
18coin_creator_vault_authorityPubkey
19fee_configPubkey
20fee_programPubkey
21…remainingVec<AccountMeta>

SetCoinCreator#

From the program's IDL:

Sets Pool::coin_creator from Metaplex metadata creator or
BondingCurve::creator

Discriminator d295802dbc3a4eaf · data SetCoinCreator · accounts SetCoinCreatorInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of SetCoinCreatorInstructionAccounts, in account order:

#FieldType
0poolPubkey
1metadataPubkey
2bonding_curvePubkey
3event_authorityPubkey
4programPubkey
5…remainingVec<AccountMeta>

SetReservedFeeRecipients#

Discriminator 6faca2e87259d58e · data SetReservedFeeRecipients · accounts SetReservedFeeRecipientsInstructionAccounts.

FieldType
whitelist_pdaPubkey

Required accounts: 4; extras go to remaining.

Fields of SetReservedFeeRecipientsInstructionAccounts, in account order:

#FieldType
0global_configPubkey
1adminPubkey
2event_authorityPubkey
3programPubkey
4…remainingVec<AccountMeta>

SyncUserVolumeAccumulator#

Discriminator 561fc057a3574fee · data SyncUserVolumeAccumulator · accounts SyncUserVolumeAccumulatorInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of SyncUserVolumeAccumulatorInstructionAccounts, in account order:

#FieldType
0userPubkey
1global_volume_accumulatorPubkey
2user_volume_accumulatorPubkey
3event_authorityPubkey
4programPubkey
5…remainingVec<AccountMeta>

ToggleCashbackEnabled#

Discriminator 7367e0ffbd5956c3 · data ToggleCashbackEnabled · accounts ToggleCashbackEnabledInstructionAccounts.

FieldType
enabledbool

Required accounts: 4; extras go to remaining.

Fields of ToggleCashbackEnabledInstructionAccounts, in account order:

#FieldType
0adminPubkey
1global_configPubkey
2event_authorityPubkey
3programPubkey
4…remainingVec<AccountMeta>

ToggleMayhemMode#

Discriminator 01096fd0641fffa3 · data ToggleMayhemMode · accounts ToggleMayhemModeInstructionAccounts.

FieldType
enabledbool

Required accounts: 4; extras go to remaining.

Fields of ToggleMayhemModeInstructionAccounts, in account order:

#FieldType
0adminPubkey
1global_configPubkey
2event_authorityPubkey
3programPubkey
4…remainingVec<AccountMeta>

TransferCreatorFeesToPump#

From the program's IDL:

Transfer creator fees to pump creator vault
If coin creator fees are currently below rent.minimum_balance(TokenAccount::LEN) The transfer will be skipped

Discriminator 8b348655e4e56cf1 · data TransferCreatorFeesToPump · accounts TransferCreatorFeesToPumpInstructionAccounts.

No data fields.

Required accounts: 10; extras go to remaining.

Fields of TransferCreatorFeesToPumpInstructionAccounts, in account order:

#FieldType
0wsol_mintPubkey
1token_programPubkey
2system_programPubkey
3associated_token_programPubkey
4coin_creatorPubkey
5coin_creator_vault_authorityPubkey
6coin_creator_vault_ataPubkey
7pump_creator_vaultPubkey
8event_authorityPubkey
9programPubkey
10…remainingVec<AccountMeta>

UpdateAdmin#

Discriminator a1b028d53cb8b3e4 · data UpdateAdmin · accounts UpdateAdminInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of UpdateAdminInstructionAccounts, in account order:

#FieldType
0adminPubkey
1global_configPubkey
2new_adminPubkey
3event_authorityPubkey
4programPubkey
5…remainingVec<AccountMeta>

UpdateFeeConfig#

Discriminator 68b867f258976b14 · data UpdateFeeConfig · accounts UpdateFeeConfigInstructionAccounts.

FieldType
lp_fee_basis_pointsu64
protocol_fee_basis_pointsu64
protocol_fee_recipients[Pubkey; 8]
coin_creator_fee_basis_pointsu64
admin_set_coin_creator_authorityPubkey

Required accounts: 4; extras go to remaining.

Fields of UpdateFeeConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1global_configPubkey
2event_authorityPubkey
3programPubkey
4…remainingVec<AccountMeta>

Withdraw#

Discriminator b712469c946da122 · data Withdraw · accounts WithdrawInstructionAccounts.

FieldType
lp_token_amount_inu64
min_base_amount_outu64
min_quote_amount_outu64

Required accounts: 15; extras go to remaining.

Fields of WithdrawInstructionAccounts, in account order:

#FieldType
0poolPubkey
1global_configPubkey
2userPubkey
3base_mintPubkey
4quote_mintPubkey
5lp_mintPubkey
6user_base_token_accountPubkey
7user_quote_token_accountPubkey
8user_pool_token_accountPubkey
9pool_base_token_accountPubkey
10pool_quote_token_accountPubkey
11token_programPubkey
12token2022_programPubkey
13event_authorityPubkey
14programPubkey
15…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 PumpSwapAccount. Each wraps a boxed struct from carbon_pump_swap_decoder::accounts::<module>. decode_account only considers accounts owned by PROGRAM_ID and returns the first variant that matches.

BondingCurve#

Discriminator 17b7f83760d8ac60 · accounts::bonding_curve::BondingCurve.

FieldType
virtual_token_reservesu64
virtual_sol_reservesu64
real_token_reservesu64
real_sol_reservesu64
token_total_supplyu64
completebool
creatorPubkey
is_mayhem_modebool
is_cashback_coinbool

FeeConfig#

Discriminator 8f3492bbdb7b4c9b · accounts::fee_config::FeeConfig.

FieldType
bumpu8
adminPubkey
flat_feesFees
fee_tiersVec<FeeTier>

GlobalConfig#

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

FieldTypeDescription
adminPubkeyThe admin pubkey
lp_fee_basis_pointsu64
protocol_fee_basis_pointsu64
disable_flagsu8Flags to disable certain functionality bit 0 - Disable create pool bit 1 - Disable deposit bit 2 - Disable withdraw bit 3 - Disable buy bit 4 - Disable sell
protocol_fee_recipients[Pubkey; 8]Addresses of the protocol fee recipients
coin_creator_fee_basis_pointsu64
admin_set_coin_creator_authorityPubkeyThe admin authority for setting coin creators
whitelist_pdaPubkey
reserved_fee_recipientPubkey
mayhem_mode_enabledbool
reserved_fee_recipients[Pubkey; 7]
is_cashback_enabledbool

GlobalVolumeAccumulator#

Discriminator ca2af62b8ebe1eff · accounts::global_volume_accumulator::GlobalVolumeAccumulator.

FieldType
start_timei64
end_timei64
seconds_in_a_dayi64
mintPubkey
total_token_supply[u64; 30]
sol_volumes[u64; 30]

Pool#

Discriminator f19a6d0411b16dbc · accounts::pool::Pool.

FieldTypeDescription
pool_bumpu8
indexu16
creatorPubkey
base_mintPubkey
quote_mintPubkey
lp_mintPubkey
pool_base_token_accountPubkey
pool_quote_token_accountPubkey
lp_supplyu64True circulating supply without burns and lock-ups
coin_creatorPubkey
is_mayhem_modebool
is_cashback_coinbool

SharingConfig#

Discriminator d84a0900388c5d4b · accounts::sharing_config::SharingConfig.

FieldType
bumpu8
versionu8
statusConfigStatus
mintPubkey
adminPubkey
admin_revokedbool
shareholdersVec<Shareholder>

UserVolumeAccumulator#

Discriminator 56ff700e66359afa · accounts::user_volume_accumulator::UserVolumeAccumulator.

FieldType
userPubkey
needs_claimbool
total_unclaimed_tokensu64
total_claimed_tokensu64
current_sol_volumeu64
last_update_timestampi64
has_total_claimed_tokensbool
cashback_earnedu64
total_cashback_claimedu64

Events#

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

AdminSetCoinCreatorEvent#

Discriminator 2ddc5d181961ac68 · events::admin_set_coin_creator_event::AdminSetCoinCreatorEventEvent.

FieldType
timestampi64
admin_set_coin_creator_authorityPubkey
base_mintPubkey
poolPubkey
old_coin_creatorPubkey
new_coin_creatorPubkey

AdminUpdateTokenIncentivesEvent#

Discriminator 93fa6c78f71d43de · events::admin_update_token_incentives_event::AdminUpdateTokenIncentivesEventEvent.

FieldType
start_timei64
end_timei64
day_numberu64
token_supply_per_dayu64
mintPubkey
seconds_in_a_dayi64
timestampi64

BuyEvent#

Discriminator 67f4521f2cf57777 · events::buy_event::BuyEventEvent.

FieldType
timestampi64
base_amount_outu64
max_quote_amount_inu64
user_base_token_reservesu64
user_quote_token_reservesu64
pool_base_token_reservesu64
pool_quote_token_reservesu64
quote_amount_inu64
lp_fee_basis_pointsu64
lp_feeu64
protocol_fee_basis_pointsu64
protocol_feeu64
quote_amount_in_with_lp_feeu64
user_quote_amount_inu64
poolPubkey
userPubkey
user_base_token_accountPubkey
user_quote_token_accountPubkey
protocol_fee_recipientPubkey
protocol_fee_recipient_token_accountPubkey
coin_creatorPubkey
coin_creator_fee_basis_pointsu64
coin_creator_feeu64
track_volumebool
total_unclaimed_tokensu64
total_claimed_tokensu64
current_sol_volumeu64
last_update_timestampi64
min_base_amount_outu64
ix_nameString
cashback_fee_basis_pointsu64
cashbacku64

ClaimCashbackEvent#

Discriminator e2d6f62107f293e5 · events::claim_cashback_event::ClaimCashbackEventEvent.

FieldType
userPubkey
amountu64
timestampi64
total_claimedu64
total_cashback_earnedu64

ClaimTokenIncentivesEvent#

Discriminator 4facf631cd5bcee8 · events::claim_token_incentives_event::ClaimTokenIncentivesEventEvent.

FieldType
userPubkey
mintPubkey
amountu64
timestampi64
total_claimed_tokensu64
current_sol_volumeu64

CloseUserVolumeAccumulatorEvent#

Discriminator 929fbdac925838f4 · events::close_user_volume_accumulator_event::CloseUserVolumeAccumulatorEventEvent.

FieldType
userPubkey
timestampi64
total_unclaimed_tokensu64
total_claimed_tokensu64
current_sol_volumeu64
last_update_timestampi64

CollectCoinCreatorFeeEvent#

Discriminator e8f5c2eeeada3a59 · events::collect_coin_creator_fee_event::CollectCoinCreatorFeeEventEvent.

FieldType
timestampi64
coin_creatorPubkey
coin_creator_feeu64
coin_creator_vault_ataPubkey
coin_creator_token_accountPubkey

CreateConfigEvent#

Discriminator 6b34598137e25116 · events::create_config_event::CreateConfigEventEvent.

FieldType
timestampi64
adminPubkey
lp_fee_basis_pointsu64
protocol_fee_basis_pointsu64
protocol_fee_recipients[Pubkey; 8]
coin_creator_fee_basis_pointsu64
admin_set_coin_creator_authorityPubkey

CreatePoolEvent#

Discriminator b1310cd2a076a774 · events::create_pool_event::CreatePoolEventEvent.

FieldType
timestampi64
indexu16
creatorPubkey
base_mintPubkey
quote_mintPubkey
base_mint_decimalsu8
quote_mint_decimalsu8
base_amount_inu64
quote_amount_inu64
pool_base_amountu64
pool_quote_amountu64
minimum_liquidityu64
initial_liquidityu64
lp_token_amount_outu64
pool_bumpu8
poolPubkey
lp_mintPubkey
user_base_token_accountPubkey
user_quote_token_accountPubkey
coin_creatorPubkey
is_mayhem_modebool

DepositEvent#

Discriminator 78f83d531f8e6b90 · events::deposit_event::DepositEventEvent.

FieldType
timestampi64
lp_token_amount_outu64
max_base_amount_inu64
max_quote_amount_inu64
user_base_token_reservesu64
user_quote_token_reservesu64
pool_base_token_reservesu64
pool_quote_token_reservesu64
base_amount_inu64
quote_amount_inu64
lp_mint_supplyu64
poolPubkey
userPubkey
user_base_token_accountPubkey
user_quote_token_accountPubkey
user_pool_token_accountPubkey

DisableEvent#

Discriminator 6bfdc14ce4ca1b68 · events::disable_event::DisableEventEvent.

FieldType
timestampi64
adminPubkey
disable_create_poolbool
disable_depositbool
disable_withdrawbool
disable_buybool
disable_sellbool

ExtendAccountEvent#

Discriminator 6161d7905d92167c · events::extend_account_event::ExtendAccountEventEvent.

FieldType
timestampi64
accountPubkey
userPubkey
current_sizeu64
new_sizeu64

InitUserVolumeAccumulatorEvent#

Discriminator 86240d48e86582d8 · events::init_user_volume_accumulator_event::InitUserVolumeAccumulatorEventEvent.

FieldType
payerPubkey
userPubkey
timestampi64

MigratePoolCoinCreatorEvent#

Discriminator aadd52c793a5f72e · events::migrate_pool_coin_creator_event::MigratePoolCoinCreatorEventEvent.

FieldType
timestampi64
base_mintPubkey
poolPubkey
sharing_configPubkey
old_coin_creatorPubkey
new_coin_creatorPubkey

ReservedFeeRecipientsEvent#

Discriminator 2bbcfa12dd4bbb5f · events::reserved_fee_recipients_event::ReservedFeeRecipientsEventEvent.

FieldType
timestampi64
reserved_fee_recipientPubkey
reserved_fee_recipients[Pubkey; 7]

SellEvent#

Discriminator 3e2f370aa503dc2a · events::sell_event::SellEventEvent.

FieldType
timestampi64
base_amount_inu64
min_quote_amount_outu64
user_base_token_reservesu64
user_quote_token_reservesu64
pool_base_token_reservesu64
pool_quote_token_reservesu64
quote_amount_outu64
lp_fee_basis_pointsu64
lp_feeu64
protocol_fee_basis_pointsu64
protocol_feeu64
quote_amount_out_without_lp_feeu64
user_quote_amount_outu64
poolPubkey
userPubkey
user_base_token_accountPubkey
user_quote_token_accountPubkey
protocol_fee_recipientPubkey
protocol_fee_recipient_token_accountPubkey
coin_creatorPubkey
coin_creator_fee_basis_pointsu64
coin_creator_feeu64
cashback_fee_basis_pointsu64
cashbacku64

SetBondingCurveCoinCreatorEvent#

Discriminator f2e7eb664163bdd3 · events::set_bonding_curve_coin_creator_event::SetBondingCurveCoinCreatorEventEvent.

FieldType
timestampi64
base_mintPubkey
poolPubkey
bonding_curvePubkey
coin_creatorPubkey

SetMetaplexCoinCreatorEvent#

Discriminator 966bc77b7ccf66e4 · events::set_metaplex_coin_creator_event::SetMetaplexCoinCreatorEventEvent.

FieldType
timestampi64
base_mintPubkey
poolPubkey
metadataPubkey
coin_creatorPubkey

SyncUserVolumeAccumulatorEvent#

Discriminator c57aa77c74515bff · events::sync_user_volume_accumulator_event::SyncUserVolumeAccumulatorEventEvent.

FieldType
userPubkey
total_claimed_tokens_beforeu64
total_claimed_tokens_afteru64
timestampi64

UpdateAdminEvent#

Discriminator e198ab57f63f42ea · events::update_admin_event::UpdateAdminEventEvent.

FieldType
timestampi64
adminPubkey
new_adminPubkey

UpdateFeeConfigEvent#

Discriminator 5a1741233ef4bcd0 · events::update_fee_config_event::UpdateFeeConfigEventEvent.

FieldType
timestampi64
adminPubkey
lp_fee_basis_pointsu64
protocol_fee_basis_pointsu64
protocol_fee_recipients[Pubkey; 8]
coin_creator_fee_basis_pointsu64
admin_set_coin_creator_authorityPubkey

WithdrawEvent#

Discriminator 1609851aa02c47c0 · events::withdraw_event::WithdrawEventEvent.

FieldType
timestampi64
lp_token_amount_inu64
min_base_amount_outu64
min_quote_amount_outu64
user_base_token_reservesu64
user_quote_token_reservesu64
pool_base_token_reservesu64
pool_quote_token_reservesu64
base_amount_outu64
quote_amount_outu64
lp_mint_supplyu64
poolPubkey
userPubkey
user_base_token_accountPubkey
user_quote_token_accountPubkey
user_pool_token_accountPubkey

Types#

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

AdminSetCoinCreatorEvent#

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

AdminUpdateTokenIncentivesEvent#

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

BuyEvent#

From the program's IDL:

ix_name: "buy" | "buy_exact_quote_in"

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

ClaimCashbackEvent#

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

ClaimTokenIncentivesEvent#

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

CloseUserVolumeAccumulatorEvent#

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

CollectCoinCreatorFeeEvent#

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

ConfigStatus#

Enum types::ConfigStatus.

Variant
Paused
Active

CreateConfigEvent#

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

CreatePoolEvent#

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

DepositEvent#

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

DisableEvent#

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

ExtendAccountEvent#

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

Fees#

Struct types::Fees.

FieldType
lp_fee_bpsu64
protocol_fee_bpsu64
creator_fee_bpsu64

FeeTier#

Struct types::FeeTier.

FieldType
market_cap_lamports_thresholdu128
feesFees

InitUserVolumeAccumulatorEvent#

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

MigratePoolCoinCreatorEvent#

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

OptionBool#

Tuple struct types::OptionBool (bool).

ReservedFeeRecipientsEvent#

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

SellEvent#

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

SetBondingCurveCoinCreatorEvent#

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

SetMetaplexCoinCreatorEvent#

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

Shareholder#

Struct types::Shareholder.

FieldType
addressPubkey
share_bpsu16

SyncUserVolumeAccumulatorEvent#

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

UpdateAdminEvent#

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

UpdateFeeConfigEvent#

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

WithdrawEvent#

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

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.