Jupiter Swap decoder

Decode Jupiter Swap instructions, accounts and events in Rust with carbon-jupiter-swap-decoder 2.0.0. Program ID JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4.

On this page

carbon-jupiter-swap-decoder decodes the instructions, accounts and events of the Jupiter Swap program (JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4): 17 instructions, 1 account type, 6 events. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-jupiter-swap-decoder 2.0.0
Installcargo add carbon-jupiter-swap-decoder@2.0.0
Program IDJUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 (carbon_jupiter_swap_decoder::PROGRAM_ID)
CategoryAggregators & routing
Decodercarbon_jupiter_swap_decoder::JupiterSwapDecoder
Instruction enuminstructions::JupiterSwapInstruction
Account enumaccounts::JupiterSwapAccount
Event enuminstructions::CpiEvent
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-jupiter-swap-decoder/2.0.0
Sourcedecoders/jupiter-swap-decoder

Other aggregator and routing decoders: DFlow Aggregator v4, OKX DEX, OnChain Labs DEX v2. To decode several in one pipeline, see aggregator and routing 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 Jupiter Swap transactions from the public RPC and prints every decoded Route instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-jupiter-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_jupiter_swap_decoder::{
        instructions::JupiterSwapInstruction, JupiterSwapDecoder, 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(JupiterSwapDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

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

Each Route instruction prints one line with the transaction signature and the decoded Route 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 JupiterSwapInstruction::CpiEvent { data: CpiEvent::FeeEvent(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 TokenLedger 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_jupiter_swap_decoder::{accounts::JupiterSwapAccount, JupiterSwapDecoder, 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(JupiterSwapDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

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

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

Claim#

Discriminator 3ec6d6c1d59f6cd2 · data Claim · accounts ClaimInstructionAccounts.

FieldType
idu8

Required accounts: 3; extras go to remaining.

Fields of ClaimInstructionAccounts, in account order:

#FieldType
0walletPubkey
1program_authorityPubkey
2system_programPubkey
3…remainingVec<AccountMeta>

ClaimToken#

Discriminator 74ce1bbfa6130049 · data ClaimToken · accounts ClaimTokenInstructionAccounts.

FieldType
idu8

Required accounts: 9; extras go to remaining.

Fields of ClaimTokenInstructionAccounts, in account order:

#FieldType
0payerPubkey
1walletPubkey
2program_authorityPubkey
3program_token_accountPubkey
4destination_token_accountPubkey
5mintPubkey
6token_programPubkey
7associated_token_programPubkey
8system_programPubkey
9…remainingVec<AccountMeta>

CloseToken#

Discriminator 1a4aec976840b7f9 · data CloseToken · accounts CloseTokenInstructionAccounts.

FieldType
idu8
burn_allbool

Required accounts: 6; extras go to remaining.

Fields of CloseTokenInstructionAccounts, in account order:

#FieldType
0operatorPubkey
1walletPubkey
2program_authorityPubkey
3program_token_accountPubkey
4mintPubkey
5token_programPubkey
6…remainingVec<AccountMeta>

CloseWsolTokenAccount#

Discriminator cb816785c57d6b56 · data CloseWsolTokenAccount · accounts CloseWsolTokenAccountInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of CloseWsolTokenAccountInstructionAccounts, in account order:

#FieldType
0token_accountPubkey
1userPubkey
2token_programPubkey
3system_programPubkey
4…remainingVec<AccountMeta>

CreateTokenAccount#

Discriminator 93f17b64f484ae76 · data CreateTokenAccount · accounts CreateTokenAccountInstructionAccounts.

FieldType
bumpu8

Required accounts: 5; extras go to remaining.

Fields of CreateTokenAccountInstructionAccounts, in account order:

#FieldType
0token_accountPubkey
1userPubkey
2mintPubkey
3token_programPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

CreateTokenLedger#

Discriminator e8f2c5fdf08f8134 · data CreateTokenLedger · accounts CreateTokenLedgerInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of CreateTokenLedgerInstructionAccounts, in account order:

#FieldType
0token_ledgerPubkey
1payerPubkey
2system_programPubkey
3…remainingVec<AccountMeta>

ExactOutRoute#

Discriminator d033ef977b2bed5c · data ExactOutRoute · accounts ExactOutRouteInstructionAccounts.

FieldType
route_planVec<RoutePlanStep>
out_amountu64
quoted_in_amountu64
slippage_bpsu16
platform_fee_bpsu8

Required accounts: 11; extras go to remaining.

Fields of ExactOutRouteInstructionAccounts, in account order:

#FieldType
0token_programPubkey
1user_transfer_authorityPubkey
2user_source_token_accountPubkey
3user_destination_token_accountPubkey
4destination_token_accountOption<Pubkey>
5source_mintPubkey
6destination_mintPubkey
7platform_fee_accountOption<Pubkey>
8token2022_programOption<Pubkey>
9event_authorityPubkey
10programPubkey
11…remainingVec<AccountMeta>

ExactOutRouteV2#

Discriminator 9d8ab85215f4f324 · data ExactOutRouteV2 · accounts ExactOutRouteV2InstructionAccounts.

FieldType
out_amountu64
quoted_in_amountu64
slippage_bpsu16
platform_fee_bpsu16
positive_slippage_bpsu16
route_planVec<RoutePlanStepV2>

Required accounts: 10; extras go to remaining.

Fields of ExactOutRouteV2InstructionAccounts, in account order:

#FieldType
0user_transfer_authorityPubkey
1user_source_token_accountPubkey
2user_destination_token_accountPubkey
3source_mintPubkey
4destination_mintPubkey
5source_token_programPubkey
6destination_token_programPubkey
7destination_token_accountOption<Pubkey>
8event_authorityPubkey
9programPubkey
10…remainingVec<AccountMeta>

Route#

Discriminator e517cb977ae3ad2a · data Route · accounts RouteInstructionAccounts.

FieldType
route_planVec<RoutePlanStep>
in_amountu64
quoted_out_amountu64
slippage_bpsu16
platform_fee_bpsu8

Required accounts: 9; extras go to remaining.

Fields of RouteInstructionAccounts, in account order:

#FieldType
0token_programPubkey
1user_transfer_authorityPubkey
2user_source_token_accountPubkey
3user_destination_token_accountPubkey
4destination_token_accountOption<Pubkey>
5destination_mintPubkey
6platform_fee_accountOption<Pubkey>
7event_authorityPubkey
8programPubkey
9…remainingVec<AccountMeta>

RouteV2#

Discriminator bb64facc31c4af14 · data RouteV2 · accounts RouteV2InstructionAccounts.

FieldType
in_amountu64
quoted_out_amountu64
slippage_bpsu16
platform_fee_bpsu16
positive_slippage_bpsu16
route_planVec<RoutePlanStepV2>

Required accounts: 10; extras go to remaining.

Fields of RouteV2InstructionAccounts, in account order:

#FieldType
0user_transfer_authorityPubkey
1user_source_token_accountPubkey
2user_destination_token_accountPubkey
3source_mintPubkey
4destination_mintPubkey
5source_token_programPubkey
6destination_token_programPubkey
7destination_token_accountOption<Pubkey>
8event_authorityPubkey
9programPubkey
10…remainingVec<AccountMeta>

RouteWithTokenLedger#

Discriminator 96564774a75d0e68 · data RouteWithTokenLedger · accounts RouteWithTokenLedgerInstructionAccounts.

FieldType
route_planVec<RoutePlanStep>
quoted_out_amountu64
slippage_bpsu16
platform_fee_bpsu8

Required accounts: 10; extras go to remaining.

Fields of RouteWithTokenLedgerInstructionAccounts, in account order:

#FieldType
0token_programPubkey
1user_transfer_authorityPubkey
2user_source_token_accountPubkey
3user_destination_token_accountPubkey
4destination_token_accountOption<Pubkey>
5destination_mintPubkey
6platform_fee_accountOption<Pubkey>
7token_ledgerPubkey
8event_authorityPubkey
9programPubkey
10…remainingVec<AccountMeta>

SetTokenLedger#

Discriminator e455b9704e4f4d02 · data SetTokenLedger · accounts SetTokenLedgerInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of SetTokenLedgerInstructionAccounts, in account order:

#FieldType
0token_ledgerPubkey
1token_accountPubkey
2…remainingVec<AccountMeta>

SharedAccountsExactOutRoute#

Discriminator b0d169a89a7d453e · data SharedAccountsExactOutRoute · accounts SharedAccountsExactOutRouteInstructionAccounts.

FieldType
idu8
route_planVec<RoutePlanStep>
out_amountu64
quoted_in_amountu64
slippage_bpsu16
platform_fee_bpsu8

Required accounts: 13; extras go to remaining.

Fields of SharedAccountsExactOutRouteInstructionAccounts, in account order:

#FieldType
0token_programPubkey
1program_authorityPubkey
2user_transfer_authorityPubkey
3source_token_accountPubkey
4program_source_token_accountPubkey
5program_destination_token_accountPubkey
6destination_token_accountPubkey
7source_mintPubkey
8destination_mintPubkey
9platform_fee_accountOption<Pubkey>
10token2022_programOption<Pubkey>
11event_authorityPubkey
12programPubkey
13…remainingVec<AccountMeta>

SharedAccountsExactOutRouteV2#

Discriminator 3560e5cad8bbfa18 · data SharedAccountsExactOutRouteV2 · accounts SharedAccountsExactOutRouteV2InstructionAccounts.

FieldType
idu8
out_amountu64
quoted_in_amountu64
slippage_bpsu16
platform_fee_bpsu16
positive_slippage_bpsu16
route_planVec<RoutePlanStepV2>

Required accounts: 12; extras go to remaining.

Fields of SharedAccountsExactOutRouteV2InstructionAccounts, in account order:

#FieldType
0program_authorityPubkey
1user_transfer_authorityPubkey
2source_token_accountPubkey
3program_source_token_accountPubkey
4program_destination_token_accountPubkey
5destination_token_accountPubkey
6source_mintPubkey
7destination_mintPubkey
8source_token_programPubkey
9destination_token_programPubkey
10event_authorityPubkey
11programPubkey
12…remainingVec<AccountMeta>

SharedAccountsRoute#

Discriminator c1209b3341d69c81 · data SharedAccountsRoute · accounts SharedAccountsRouteInstructionAccounts.

FieldType
idu8
route_planVec<RoutePlanStep>
in_amountu64
quoted_out_amountu64
slippage_bpsu16
platform_fee_bpsu8

Required accounts: 13; extras go to remaining.

Fields of SharedAccountsRouteInstructionAccounts, in account order:

#FieldType
0token_programPubkey
1program_authorityPubkey
2user_transfer_authorityPubkey
3source_token_accountPubkey
4program_source_token_accountPubkey
5program_destination_token_accountPubkey
6destination_token_accountPubkey
7source_mintPubkey
8destination_mintPubkey
9platform_fee_accountOption<Pubkey>
10token2022_programOption<Pubkey>
11event_authorityPubkey
12programPubkey
13…remainingVec<AccountMeta>

SharedAccountsRouteV2#

Discriminator d19853937cfed8e9 · data SharedAccountsRouteV2 · accounts SharedAccountsRouteV2InstructionAccounts.

FieldType
idu8
in_amountu64
quoted_out_amountu64
slippage_bpsu16
platform_fee_bpsu16
positive_slippage_bpsu16
route_planVec<RoutePlanStepV2>

Required accounts: 12; extras go to remaining.

Fields of SharedAccountsRouteV2InstructionAccounts, in account order:

#FieldType
0program_authorityPubkey
1user_transfer_authorityPubkey
2source_token_accountPubkey
3program_source_token_accountPubkey
4program_destination_token_accountPubkey
5destination_token_accountPubkey
6source_mintPubkey
7destination_mintPubkey
8source_token_programPubkey
9destination_token_programPubkey
10event_authorityPubkey
11programPubkey
12…remainingVec<AccountMeta>

SharedAccountsRouteWithTokenLedger#

Discriminator e6798f50779f6aaa · data SharedAccountsRouteWithTokenLedger · accounts SharedAccountsRouteWithTokenLedgerInstructionAccounts.

FieldType
idu8
route_planVec<RoutePlanStep>
quoted_out_amountu64
slippage_bpsu16
platform_fee_bpsu8

Required accounts: 14; extras go to remaining.

Fields of SharedAccountsRouteWithTokenLedgerInstructionAccounts, in account order:

#FieldType
0token_programPubkey
1program_authorityPubkey
2user_transfer_authorityPubkey
3source_token_accountPubkey
4program_source_token_accountPubkey
5program_destination_token_accountPubkey
6destination_token_accountPubkey
7source_mintPubkey
8destination_mintPubkey
9platform_fee_accountOption<Pubkey>
10token2022_programOption<Pubkey>
11token_ledgerPubkey
12event_authorityPubkey
13programPubkey
14…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 JupiterSwapAccount. Each wraps a boxed struct from carbon_jupiter_swap_decoder::accounts::<module>. decode_account only considers accounts owned by PROGRAM_ID and returns the first variant that matches.

TokenLedger#

Discriminator 9cf709bc366c554d · accounts::token_ledger::TokenLedger.

FieldType
token_accountPubkey
amountu64

Events#

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

FeeEvent#

Discriminator 494f4e7fb8d50ddc · events::fee_event::FeeEventEvent.

FieldType
accountPubkey
mintPubkey
amountu64

SwapEvent#

Discriminator 40c6cde8260871e2 · events::swap_event::SwapEventEvent.

FieldType
ammPubkey
input_mintPubkey
input_amountu64
output_mintPubkey
output_amountu64

SwapsEvent#

Discriminator 982f4eebc0606e6a · events::swaps_event::SwapsEventEvent.

FieldType
swap_eventsVec<SwapEventV2>

CandidateSwapResults#

Discriminator 2d09f41ee534a87b · events::candidate_swap_results::CandidateSwapResultsEvent.

FieldType
resultsVec<CandidateSwapResult>

CandidateSwapQuoteError#

Discriminator f886253791b1724f · events::candidate_swap_quote_error::CandidateSwapQuoteErrorEvent.

FieldType
candidate_indexu64
in_amountu64
error_codeu64

BestSwapOutAmountViolation#

Discriminator 7c42c433daad2e5d · events::best_swap_out_amount_violation::BestSwapOutAmountViolationEvent.

FieldType
expected_out_amountu64
out_amountu64

Types#

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

AccountsType#

Enum types::AccountsType.

Variant
TransferHookA
TransferHookB
TransferHookReward
TransferHookInput
TransferHookIntermediate
TransferHookOutput
SupplementalTickArrays
SupplementalTickArraysOne
SupplementalTickArraysTwo

BestSwapOutAmountViolation#

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

CandidateSwap#

Enum types::CandidateSwap.

VariantFields
HumidiFiswap_id: u64, is_base_to_quote: bool
TesseraVside: Side
HumidiFiV2swap_id: u64, is_base_to_quote: bool
RaydiumV2
RaydiumClmm
Whirlpoola_to_b: bool
ZeroFi
BisonFiV2a_to_b: bool
GoonFiV2is_bid: bool
GoonFiV3is_bid: bool
WhirlpoolV2a_to_b: bool, remaining_accounts_info: Option<RemainingAccountsInfo>

CandidateSwapQuoteError#

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

CandidateSwapResult#

Enum types::CandidateSwapResult.

VariantFields
OutAmountu64
ProgramErroru64

CandidateSwapResults#

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

CandidateSwapWithBps#

Struct types::CandidateSwapWithBps.

FieldType
candidate_swapCandidateSwap
bpsu32

DefiTunaAccountsType#

Enum types::DefiTunaAccountsType.

Variant
TransferHookA
TransferHookB
TransferHookInput
TransferHookIntermediate
TransferHookOutput
SupplementalTickArrays
SupplementalTickArraysOne
SupplementalTickArraysTwo

FeeEvent#

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

HyloSwapType#

Enum types::HyloSwapType.

Variant
MintStable
RedeemStable
MintLever
RedeemLever
SwapStableToLever
SwapLeverToStable
StabilityPoolDeposit
StabilityPoolWithdraw

RemainingAccountsInfo#

Struct types::RemainingAccountsInfo.

RemainingAccountsSlice#

Struct types::RemainingAccountsSlice.

FieldType
accounts_typeu8
lengthu8

RoutePlanStep#

Struct types::RoutePlanStep.

FieldType
swapSwap
percentu8
input_indexu8
output_indexu8

RoutePlanStepV2#

Struct types::RoutePlanStepV2.

FieldType
swapSwap
bpsu16
input_indexu8
output_indexu8

Side#

Enum types::Side.

Variant
Bid
Ask

Swap#

Enum types::Swap.

VariantFields
Saber
SaberAddDecimalsDeposit
SaberAddDecimalsWithdraw
TokenSwap
Sencha
Step
Cropper
Raydium
Cremaa_to_b: bool
Lifinity
Mercurial
Cykura
Serumside: Side
MarinadeDeposit
MarinadeUnstake
Aldrinside: Side
AldrinV2side: Side
Whirlpoola_to_b: bool
Invariantx_to_y: bool
Meteora
GooseFX
DeltaFistable: bool
Balansol
MarcoPolox_to_y: bool
Dradexside: Side
LifinityV2
RaydiumClmm
Openbookside: Side
Phoenixside: Side
Symmetryfrom_token_id: u64, to_token_id: u64
TokenSwapV2
HeliumTreasuryManagementRedeemV0
StakeDexStakeWrappedSol
StakeDexSwapViaStakebridge_stake_seed: u32
GooseFXV2
Perps
PerpsAddLiquidity
PerpsRemoveLiquidity
MeteoraDlmm
OpenBookV2side: Side
RaydiumClmmV2
StakeDexPrefundWithdrawStakeAndDepositStakebridge_stake_seed: u32
Clonepool_index: u8, quantity_is_input: bool, quantity_is_collateral: bool
SanctumSsrc_lst_value_calc_accs: u8, dst_lst_value_calc_accs: u8, src_lst_index: u32, dst_lst_index: u32
SanctumSAddLiquiditylst_value_calc_accs: u8, lst_index: u32
SanctumSRemoveLiquiditylst_value_calc_accs: u8, lst_index: u32
RaydiumCP
WhirlpoolSwapV2a_to_b: bool, remaining_accounts_info: Option<RemainingAccountsInfo>
OneIntro
PumpWrappedBuy
PumpWrappedSell
PerpsV2
PerpsV2AddLiquidity
PerpsV2RemoveLiquidity
MoonshotWrappedBuy
MoonshotWrappedSell
StabbleStableSwap
StabbleWeightedSwap
Obricx_to_y: bool
FoxBuyFromEstimatedCost
FoxClaimPartialis_y: bool
SolFiis_quote_to_base: bool
SolayerDelegateNoInit
SolayerUndelegateNoInit
TokenMillside: Side
DaosFunBuy
DaosFunSell
ZeroFi
StakeDexWithdrawWrappedSol
VirtualsBuy
VirtualsSell
Perenain_index: u8, out_index: u8
PumpSwapBuy
PumpSwapSell
Gamma
MeteoraDlmmSwapV2remaining_accounts_info: RemainingAccountsInfo
Woofi
MeteoraDammV2
MeteoraDynamicBondingCurveSwap
StabbleStableSwapV2
StabbleWeightedSwapV2
RaydiumLaunchlabBuyshare_fee_rate: u64
RaydiumLaunchlabSellshare_fee_rate: u64
BoopdotfunWrappedBuy
BoopdotfunWrappedSell
Plasmaside: Side
GoonFiis_bid: bool, blacklist_bump: u8
HumidiFiswap_id: u64, is_base_to_quote: bool
MeteoraDynamicBondingCurveSwapWithRemainingAccounts
TesseraVside: Side
PumpWrappedBuyV2
PumpWrappedSellV2
PumpSwapBuyV2
PumpSwapSellV2
Heavena_to_b: bool
SolFiV2is_quote_to_base: bool
Aquifer
PumpWrappedBuyV3
PumpWrappedSellV3
PumpSwapBuyV3
PumpSwapSellV3
JupiterLendDeposit
JupiterLendRedeem
DefiTunaa_to_b: bool, remaining_accounts_info: Option<RemainingAccountsInfo>
AlphaQa_to_b: bool
RaydiumV2
SarosDlmmswap_for_y: bool
Futarchyside: Side
MeteoraDammV2WithRemainingAccounts
Obsidian
WhaleStreetside: Side
DynamicV1candidate_swaps: Vec<CandidateSwap>, best_position: Option<u8>
PumpWrappedBuyV4
PumpWrappedSellV4
CarrotIssue
CarrotRedeem
Manifestside: Side
BisonFia_to_b: bool
HumidiFiV2swap_id: u64, is_base_to_quote: bool
PerenaStaris_mint: bool
JupiterRfqV2side: Side, fill_data: Vec<u8>
GoonFiV2is_bid: bool
Scorchswap_id: u128
VaultLiquidUnstakelst_amounts: [u64; 5], seed: u64
XOrca
Quantumside: Side
WhaleStreetV2side: Side, auth_amount_in: u64, auth: u64
Riptideamount_is_token_a: bool
RunnerRodeo
TaurusFiis_base_in: bool
Omnipair
MSwap
Hyloswap_type: HyloSwapType
VoltrDeposit
VoltrWithdraw
SanctumSV2src_lst_value_calc_accs: u8, dst_lst_value_calc_accs: u8, src_lst_index: u32, dst_lst_index: u32
LemmingsFiis_base_in: bool
ScaleVmmBuy
ScaleVmmSell
ScaleAmmBuy
ScaleAmmSell
BisonFiV2a_to_b: bool
Trends
HumaDeposit
HumaInstantWithdraw
Kipseliis_base_to_quote: bool
DynamicV2candidate_swaps: Vec<CandidateSwapWithBps>, max_split_quote_calls: u8, max_split_candidates: u8
PumpSwapBuyV3WithCashbackClaim
PumpSwapSellV3WithCashbackClaim
PumpWrappedBuyV4WithCashbackClaim
PumpWrappedSellV4WithCashbackClaim
GoonFiV3is_bid: bool

SwapEvent#

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

SwapEventV2#

Struct types::SwapEventV2.

FieldType
input_mintPubkey
input_amountu64
output_mintPubkey
output_amountu64

SwapsEvent#

Struct types::SwapsEvent. Same fields as the SwapsEvent 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.