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.
| Crate | carbon-jupiter-swap-decoder 2.0.0 |
| Install | cargo add carbon-jupiter-swap-decoder@2. |
| Program ID | JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 (carbon_) |
| Category | Aggregators & routing |
| Decoder | carbon_ |
| Instruction enum | instructions:: |
| Account enum | accounts:: |
| Event enum | instructions:: |
| Features | serde, postgres, graphql (none enabled by default) |
| API docs | docs.rs/carbon-jupiter-swap-decoder/2.0.0 |
| Source | decoders/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:
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/fulluse {
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(())
}
}RUST_LOG=info cargo runEach 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:: (import instructions::); see Events. If CpiEvent never arrives, the program logs its events with emit! instead: decode them with decode_.
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:
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2use {
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(())
}
}RUST_LOG=info cargo runEach 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::, where data and accounts are the types listed under the variant, exported from carbon_. 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:
- The instruction's program ID is
JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4. - The data starts with the variant's discriminator, and the rest deserializes into its data type.
- 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_ too. Accounts after the listed ones are in accounts. as AccountMetas. The decoder doesn't record whether an account signed or was writable: read that from input. and ., 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.
| Field | Type |
|---|---|
id | u8 |
Required accounts: 3; extras go to remaining.
Fields of ClaimInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | wallet | Pubkey |
| 1 | program_ | Pubkey |
| 2 | system_ | Pubkey |
| 3… | remaining | Vec< |
ClaimToken#
Discriminator 74ce1bbfa6130049 · data ClaimToken · accounts ClaimTokenInstructionAccounts.
| Field | Type |
|---|---|
id | u8 |
Required accounts: 9; extras go to remaining.
Fields of ClaimTokenInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | payer | Pubkey |
| 1 | wallet | Pubkey |
| 2 | program_ | Pubkey |
| 3 | program_ | Pubkey |
| 4 | destination_ | Pubkey |
| 5 | mint | Pubkey |
| 6 | token_ | Pubkey |
| 7 | associated_ | Pubkey |
| 8 | system_ | Pubkey |
| 9… | remaining | Vec< |
CloseToken#
Discriminator 1a4aec976840b7f9 · data CloseToken · accounts CloseTokenInstructionAccounts.
| Field | Type |
|---|---|
id | u8 |
burn_all | bool |
Required accounts: 6; extras go to remaining.
Fields of CloseTokenInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | operator | Pubkey |
| 1 | wallet | Pubkey |
| 2 | program_ | Pubkey |
| 3 | program_ | Pubkey |
| 4 | mint | Pubkey |
| 5 | token_ | Pubkey |
| 6… | remaining | Vec< |
CloseWsolTokenAccount#
Discriminator cb816785c57d6b56 · data CloseWsolTokenAccount · accounts CloseWsolTokenAccountInstructionAccounts.
No data fields.
Required accounts: 4; extras go to remaining.
Fields of CloseWsolTokenAccountInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | user | Pubkey |
| 2 | token_ | Pubkey |
| 3 | system_ | Pubkey |
| 4… | remaining | Vec< |
CreateTokenAccount#
Discriminator 93f17b64f484ae76 · data CreateTokenAccount · accounts CreateTokenAccountInstructionAccounts.
| Field | Type |
|---|---|
bump | u8 |
Required accounts: 5; extras go to remaining.
Fields of CreateTokenAccountInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | user | Pubkey |
| 2 | mint | Pubkey |
| 3 | token_ | Pubkey |
| 4 | system_ | Pubkey |
| 5… | remaining | Vec< |
CreateTokenLedger#
Discriminator e8f2c5fdf08f8134 · data CreateTokenLedger · accounts CreateTokenLedgerInstructionAccounts.
No data fields.
Required accounts: 3; extras go to remaining.
Fields of CreateTokenLedgerInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | payer | Pubkey |
| 2 | system_ | Pubkey |
| 3… | remaining | Vec< |
ExactOutRoute#
Discriminator d033ef977b2bed5c · data ExactOutRoute · accounts ExactOutRouteInstructionAccounts.
| Field | Type |
|---|---|
route_plan | Vec< |
out_amount | u64 |
quoted_ | u64 |
slippage_ | u16 |
platform_ | u8 |
Required accounts: 11; extras go to remaining.
Fields of ExactOutRouteInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | user_ | Pubkey |
| 2 | user_ | Pubkey |
| 3 | user_ | Pubkey |
| 4 | destination_ | Option< |
| 5 | source_mint | Pubkey |
| 6 | destination_ | Pubkey |
| 7 | platform_ | Option< |
| 8 | token2022_ | Option< |
| 9 | event_ | Pubkey |
| 10 | program | Pubkey |
| 11… | remaining | Vec< |
ExactOutRouteV2#
Discriminator 9d8ab85215f4f324 · data ExactOutRouteV2 · accounts ExactOutRouteV2InstructionAccounts.
| Field | Type |
|---|---|
out_amount | u64 |
quoted_ | u64 |
slippage_ | u16 |
platform_ | u16 |
positive_ | u16 |
route_plan | Vec< |
Required accounts: 10; extras go to remaining.
Fields of ExactOutRouteV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | user_ | Pubkey |
| 1 | user_ | Pubkey |
| 2 | user_ | Pubkey |
| 3 | source_mint | Pubkey |
| 4 | destination_ | Pubkey |
| 5 | source_ | Pubkey |
| 6 | destination_ | Pubkey |
| 7 | destination_ | Option< |
| 8 | event_ | Pubkey |
| 9 | program | Pubkey |
| 10… | remaining | Vec< |
Route#
Discriminator e517cb977ae3ad2a · data Route · accounts RouteInstructionAccounts.
| Field | Type |
|---|---|
route_plan | Vec< |
in_amount | u64 |
quoted_ | u64 |
slippage_ | u16 |
platform_ | u8 |
Required accounts: 9; extras go to remaining.
Fields of RouteInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | user_ | Pubkey |
| 2 | user_ | Pubkey |
| 3 | user_ | Pubkey |
| 4 | destination_ | Option< |
| 5 | destination_ | Pubkey |
| 6 | platform_ | Option< |
| 7 | event_ | Pubkey |
| 8 | program | Pubkey |
| 9… | remaining | Vec< |
RouteV2#
Discriminator bb64facc31c4af14 · data RouteV2 · accounts RouteV2InstructionAccounts.
| Field | Type |
|---|---|
in_amount | u64 |
quoted_ | u64 |
slippage_ | u16 |
platform_ | u16 |
positive_ | u16 |
route_plan | Vec< |
Required accounts: 10; extras go to remaining.
Fields of RouteV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | user_ | Pubkey |
| 1 | user_ | Pubkey |
| 2 | user_ | Pubkey |
| 3 | source_mint | Pubkey |
| 4 | destination_ | Pubkey |
| 5 | source_ | Pubkey |
| 6 | destination_ | Pubkey |
| 7 | destination_ | Option< |
| 8 | event_ | Pubkey |
| 9 | program | Pubkey |
| 10… | remaining | Vec< |
RouteWithTokenLedger#
Discriminator 96564774a75d0e68 · data RouteWithTokenLedger · accounts RouteWithTokenLedgerInstructionAccounts.
| Field | Type |
|---|---|
route_plan | Vec< |
quoted_ | u64 |
slippage_ | u16 |
platform_ | u8 |
Required accounts: 10; extras go to remaining.
Fields of RouteWithTokenLedgerInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | user_ | Pubkey |
| 2 | user_ | Pubkey |
| 3 | user_ | Pubkey |
| 4 | destination_ | Option< |
| 5 | destination_ | Pubkey |
| 6 | platform_ | Option< |
| 7 | token_ | Pubkey |
| 8 | event_ | Pubkey |
| 9 | program | Pubkey |
| 10… | remaining | Vec< |
SetTokenLedger#
Discriminator e455b9704e4f4d02 · data SetTokenLedger · accounts SetTokenLedgerInstructionAccounts.
No data fields.
Required accounts: 2; extras go to remaining.
Fields of SetTokenLedgerInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | token_ | Pubkey |
| 2… | remaining | Vec< |
SharedAccountsExactOutRoute#
Discriminator b0d169a89a7d453e · data SharedAccountsExactOutRoute · accounts SharedAccountsExactOutRouteInstructionAccounts.
| Field | Type |
|---|---|
id | u8 |
route_plan | Vec< |
out_amount | u64 |
quoted_ | u64 |
slippage_ | u16 |
platform_ | u8 |
Required accounts: 13; extras go to remaining.
Fields of SharedAccountsExactOutRouteInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | program_ | Pubkey |
| 2 | user_ | Pubkey |
| 3 | source_ | Pubkey |
| 4 | program_ | Pubkey |
| 5 | program_ | Pubkey |
| 6 | destination_ | Pubkey |
| 7 | source_mint | Pubkey |
| 8 | destination_ | Pubkey |
| 9 | platform_ | Option< |
| 10 | token2022_ | Option< |
| 11 | event_ | Pubkey |
| 12 | program | Pubkey |
| 13… | remaining | Vec< |
SharedAccountsExactOutRouteV2#
Discriminator 3560e5cad8bbfa18 · data SharedAccountsExactOutRouteV2 · accounts SharedAccountsExactOutRouteV2InstructionAccounts.
| Field | Type |
|---|---|
id | u8 |
out_amount | u64 |
quoted_ | u64 |
slippage_ | u16 |
platform_ | u16 |
positive_ | u16 |
route_plan | Vec< |
Required accounts: 12; extras go to remaining.
Fields of SharedAccountsExactOutRouteV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | program_ | Pubkey |
| 1 | user_ | Pubkey |
| 2 | source_ | Pubkey |
| 3 | program_ | Pubkey |
| 4 | program_ | Pubkey |
| 5 | destination_ | Pubkey |
| 6 | source_mint | Pubkey |
| 7 | destination_ | Pubkey |
| 8 | source_ | Pubkey |
| 9 | destination_ | Pubkey |
| 10 | event_ | Pubkey |
| 11 | program | Pubkey |
| 12… | remaining | Vec< |
SharedAccountsRoute#
Discriminator c1209b3341d69c81 · data SharedAccountsRoute · accounts SharedAccountsRouteInstructionAccounts.
| Field | Type |
|---|---|
id | u8 |
route_plan | Vec< |
in_amount | u64 |
quoted_ | u64 |
slippage_ | u16 |
platform_ | u8 |
Required accounts: 13; extras go to remaining.
Fields of SharedAccountsRouteInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | program_ | Pubkey |
| 2 | user_ | Pubkey |
| 3 | source_ | Pubkey |
| 4 | program_ | Pubkey |
| 5 | program_ | Pubkey |
| 6 | destination_ | Pubkey |
| 7 | source_mint | Pubkey |
| 8 | destination_ | Pubkey |
| 9 | platform_ | Option< |
| 10 | token2022_ | Option< |
| 11 | event_ | Pubkey |
| 12 | program | Pubkey |
| 13… | remaining | Vec< |
SharedAccountsRouteV2#
Discriminator d19853937cfed8e9 · data SharedAccountsRouteV2 · accounts SharedAccountsRouteV2InstructionAccounts.
| Field | Type |
|---|---|
id | u8 |
in_amount | u64 |
quoted_ | u64 |
slippage_ | u16 |
platform_ | u16 |
positive_ | u16 |
route_plan | Vec< |
Required accounts: 12; extras go to remaining.
Fields of SharedAccountsRouteV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | program_ | Pubkey |
| 1 | user_ | Pubkey |
| 2 | source_ | Pubkey |
| 3 | program_ | Pubkey |
| 4 | program_ | Pubkey |
| 5 | destination_ | Pubkey |
| 6 | source_mint | Pubkey |
| 7 | destination_ | Pubkey |
| 8 | source_ | Pubkey |
| 9 | destination_ | Pubkey |
| 10 | event_ | Pubkey |
| 11 | program | Pubkey |
| 12… | remaining | Vec< |
SharedAccountsRouteWithTokenLedger#
Discriminator e6798f50779f6aaa · data SharedAccountsRouteWithTokenLedger · accounts SharedAccountsRouteWithTokenLedgerInstructionAccounts.
| Field | Type |
|---|---|
id | u8 |
route_plan | Vec< |
quoted_ | u64 |
slippage_ | u16 |
platform_ | u8 |
Required accounts: 14; extras go to remaining.
Fields of SharedAccountsRouteWithTokenLedgerInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | program_ | Pubkey |
| 2 | user_ | Pubkey |
| 3 | source_ | Pubkey |
| 4 | program_ | Pubkey |
| 5 | program_ | Pubkey |
| 6 | destination_ | Pubkey |
| 7 | source_mint | Pubkey |
| 8 | destination_ | Pubkey |
| 9 | platform_ | Option< |
| 10 | token2022_ | Option< |
| 11 | token_ | Pubkey |
| 12 | event_ | Pubkey |
| 13 | program | Pubkey |
| 14… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | program | Pubkey |
| 1 | event_ | Pubkey |
| 2… | remaining | Vec< |
Accounts#
Variants of JupiterSwapAccount. Each wraps a boxed struct from carbon_. decode_ only considers accounts owned by PROGRAM_ID and returns the first variant that matches.
TokenLedger#
Discriminator 9cf709bc366c554d · accounts::.
| Field | Type |
|---|---|
token_ | Pubkey |
amount | u64 |
Events#
Variants of instructions::, decoded from the CpiEvent instruction. Each wraps a struct from carbon_. The discriminator is the 8-byte event discriminator that follows the e445a52e51cb9a1d CPI-event tag.
FeeEvent#
Discriminator 494f4e7fb8d50ddc · events::.
| Field | Type |
|---|---|
account | Pubkey |
mint | Pubkey |
amount | u64 |
SwapEvent#
Discriminator 40c6cde8260871e2 · events::.
| Field | Type |
|---|---|
amm | Pubkey |
input_mint | Pubkey |
input_ | u64 |
output_mint | Pubkey |
output_ | u64 |
SwapsEvent#
Discriminator 982f4eebc0606e6a · events::.
| Field | Type |
|---|---|
swap_events | Vec< |
CandidateSwapResults#
Discriminator 2d09f41ee534a87b · events::.
| Field | Type |
|---|---|
results | Vec< |
CandidateSwapQuoteError#
Discriminator f886253791b1724f · events::.
| Field | Type |
|---|---|
candidate_ | u64 |
in_amount | u64 |
error_code | u64 |
BestSwapOutAmountViolation#
Discriminator 7c42c433daad2e5d · events::.
| Field | Type |
|---|---|
expected_ | u64 |
out_amount | u64 |
Types#
Types used by the instructions, accounts and events above, exported from carbon_.
AccountsType#
Enum types::.
| Variant |
|---|
TransferHookA |
TransferHookB |
TransferHookReward |
TransferHookInput |
TransferHookIntermediate |
TransferHookOutput |
SupplementalTickArrays |
SupplementalTickArraysOne |
SupplementalTickArraysTwo |
BestSwapOutAmountViolation#
Struct types::. Same fields as the BestSwapOutAmountViolation event.
CandidateSwap#
Enum types::.
| Variant | Fields |
|---|---|
HumidiFi | swap_id: u64, is_: bool |
TesseraV | side: Side |
HumidiFiV2 | swap_id: u64, is_: bool |
RaydiumV2 | |
RaydiumClmm | |
Whirlpool | a_to_b: bool |
ZeroFi | |
BisonFiV2 | a_to_b: bool |
GoonFiV2 | is_bid: bool |
GoonFiV3 | is_bid: bool |
WhirlpoolV2 | a_to_b: bool, remaining_: Option< |
CandidateSwapQuoteError#
Struct types::. Same fields as the CandidateSwapQuoteError event.
CandidateSwapResult#
Enum types::.
| Variant | Fields |
|---|---|
OutAmount | u64 |
ProgramError | u64 |
CandidateSwapResults#
Struct types::. Same fields as the CandidateSwapResults event.
CandidateSwapWithBps#
Struct types::.
| Field | Type |
|---|---|
candidate_ | CandidateSwap |
bps | u32 |
DefiTunaAccountsType#
Enum types::.
| Variant |
|---|
TransferHookA |
TransferHookB |
TransferHookInput |
TransferHookIntermediate |
TransferHookOutput |
SupplementalTickArrays |
SupplementalTickArraysOne |
SupplementalTickArraysTwo |
FeeEvent#
Struct types::. Same fields as the FeeEvent event.
HyloSwapType#
Enum types::.
| Variant |
|---|
MintStable |
RedeemStable |
MintLever |
RedeemLever |
SwapStableToLever |
SwapLeverToStable |
StabilityPoolDeposit |
StabilityPoolWithdraw |
RemainingAccountsInfo#
Struct types::.
| Field | Type |
|---|---|
slices | Vec< |
RemainingAccountsSlice#
Struct types::.
| Field | Type |
|---|---|
accounts_ | u8 |
length | u8 |
RoutePlanStep#
Struct types::.
| Field | Type |
|---|---|
swap | Swap |
percent | u8 |
input_index | u8 |
output_ | u8 |
RoutePlanStepV2#
Struct types::.
| Field | Type |
|---|---|
swap | Swap |
bps | u16 |
input_index | u8 |
output_ | u8 |
Side#
Enum types::Side.
| Variant |
|---|
Bid |
Ask |
Swap#
Enum types::Swap.
| Variant | Fields |
|---|---|
Saber | |
SaberAddDecimalsDeposit | |
SaberAddDecimalsWithdraw | |
TokenSwap | |
Sencha | |
Step | |
Cropper | |
Raydium | |
Crema | a_to_b: bool |
Lifinity | |
Mercurial | |
Cykura | |
Serum | side: Side |
MarinadeDeposit | |
MarinadeUnstake | |
Aldrin | side: Side |
AldrinV2 | side: Side |
Whirlpool | a_to_b: bool |
Invariant | x_to_y: bool |
Meteora | |
GooseFX | |
DeltaFi | stable: bool |
Balansol | |
MarcoPolo | x_to_y: bool |
Dradex | side: Side |
LifinityV2 | |
RaydiumClmm | |
Openbook | side: Side |
Phoenix | side: Side |
Symmetry | from_: u64, to_token_id: u64 |
TokenSwapV2 | |
HeliumTreasuryManagementRedeemV0 | |
StakeDexStakeWrappedSol | |
StakeDexSwapViaStake | bridge_: u32 |
GooseFXV2 | |
Perps | |
PerpsAddLiquidity | |
PerpsRemoveLiquidity | |
MeteoraDlmm | |
OpenBookV2 | side: Side |
RaydiumClmmV2 | |
StakeDexPrefundWithdrawStakeAndDepositStake | bridge_: u32 |
Clone | pool_index: u8, quantity_: bool, quantity_: bool |
SanctumS | src_: u8, dst_: u8, src_: u32, dst_: u32 |
SanctumSAddLiquidity | lst_: u8, lst_index: u32 |
SanctumSRemoveLiquidity | lst_: u8, lst_index: u32 |
RaydiumCP | |
WhirlpoolSwapV2 | a_to_b: bool, remaining_: Option< |
OneIntro | |
PumpWrappedBuy | |
PumpWrappedSell | |
PerpsV2 | |
PerpsV2AddLiquidity | |
PerpsV2RemoveLiquidity | |
MoonshotWrappedBuy | |
MoonshotWrappedSell | |
StabbleStableSwap | |
StabbleWeightedSwap | |
Obric | x_to_y: bool |
FoxBuyFromEstimatedCost | |
FoxClaimPartial | is_y: bool |
SolFi | is_: bool |
SolayerDelegateNoInit | |
SolayerUndelegateNoInit | |
TokenMill | side: Side |
DaosFunBuy | |
DaosFunSell | |
ZeroFi | |
StakeDexWithdrawWrappedSol | |
VirtualsBuy | |
VirtualsSell | |
Perena | in_index: u8, out_index: u8 |
PumpSwapBuy | |
PumpSwapSell | |
Gamma | |
MeteoraDlmmSwapV2 | remaining_: RemainingAccountsInfo |
Woofi | |
MeteoraDammV2 | |
MeteoraDynamicBondingCurveSwap | |
StabbleStableSwapV2 | |
StabbleWeightedSwapV2 | |
RaydiumLaunchlabBuy | share_: u64 |
RaydiumLaunchlabSell | share_: u64 |
BoopdotfunWrappedBuy | |
BoopdotfunWrappedSell | |
Plasma | side: Side |
GoonFi | is_bid: bool, blacklist_: u8 |
HumidiFi | swap_id: u64, is_: bool |
MeteoraDynamicBondingCurveSwapWithRemainingAccounts | |
TesseraV | side: Side |
PumpWrappedBuyV2 | |
PumpWrappedSellV2 | |
PumpSwapBuyV2 | |
PumpSwapSellV2 | |
Heaven | a_to_b: bool |
SolFiV2 | is_: bool |
Aquifer | |
PumpWrappedBuyV3 | |
PumpWrappedSellV3 | |
PumpSwapBuyV3 | |
PumpSwapSellV3 | |
JupiterLendDeposit | |
JupiterLendRedeem | |
DefiTuna | a_to_b: bool, remaining_: Option< |
AlphaQ | a_to_b: bool |
RaydiumV2 | |
SarosDlmm | swap_for_y: bool |
Futarchy | side: Side |
MeteoraDammV2WithRemainingAccounts | |
Obsidian | |
WhaleStreet | side: Side |
DynamicV1 | candidate_: Vec<, best_: Option<u8> |
PumpWrappedBuyV4 | |
PumpWrappedSellV4 | |
CarrotIssue | |
CarrotRedeem | |
Manifest | side: Side |
BisonFi | a_to_b: bool |
HumidiFiV2 | swap_id: u64, is_: bool |
PerenaStar | is_mint: bool |
JupiterRfqV2 | side: Side, fill_data: Vec<u8> |
GoonFiV2 | is_bid: bool |
Scorch | swap_id: u128 |
VaultLiquidUnstake | lst_amounts: [u64; 5], seed: u64 |
XOrca | |
Quantum | side: Side |
WhaleStreetV2 | side: Side, auth_: u64, auth: u64 |
Riptide | amount_: bool |
RunnerRodeo | |
TaurusFi | is_base_in: bool |
Omnipair | |
MSwap | |
Hylo | swap_type: HyloSwapType |
VoltrDeposit | |
VoltrWithdraw | |
SanctumSV2 | src_: u8, dst_: u8, src_: u32, dst_: u32 |
LemmingsFi | is_base_in: bool |
ScaleVmmBuy | |
ScaleVmmSell | |
ScaleAmmBuy | |
ScaleAmmSell | |
BisonFiV2 | a_to_b: bool |
Trends | |
HumaDeposit | |
HumaInstantWithdraw | |
Kipseli | is_: bool |
DynamicV2 | candidate_: Vec<, max_: u8, max_: u8 |
PumpSwapBuyV3WithCashbackClaim | |
PumpSwapSellV3WithCashbackClaim | |
PumpWrappedBuyV4WithCashbackClaim | |
PumpWrappedSellV4WithCashbackClaim | |
GoonFiV3 | is_bid: bool |
SwapEvent#
Struct types::. Same fields as the SwapEvent event.
SwapEventV2#
Struct types::.
| Field | Type |
|---|---|
input_mint | Pubkey |
input_ | u64 |
output_mint | Pubkey |
output_ | u64 |
SwapsEvent#
Struct types::. Same fields as the SwapsEvent event.