DFlow Aggregator v4 decoder

Decode DFlow Aggregator v4 instructions, accounts and events in Rust with the carbon-dflow-aggregator-v4-decoder crate.

On this page

carbon-dflow-aggregator-v4-decoder decodes the instructions, accounts and events of the DFlow Aggregator v4 program (DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH): 17 instructions, 1 account type, 2 events. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-dflow-aggregator-v4-decoder 2.0.0
Installcargo add carbon-dflow-aggregator-v4-decoder@2.0.0
Program IDDF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH (carbon_dflow_aggregator_v4_decoder::PROGRAM_ID)
CategoryAggregators & routing
Decodercarbon_dflow_aggregator_v4_decoder::DflowAggregatorV4Decoder
Instruction enuminstructions::DflowAggregatorV4Instruction
Account enumaccounts::DflowAggregatorV4Account
Event enuminstructions::CpiEvent
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-dflow-aggregator-v4-decoder/2.0.0
Sourcedecoders/dflow-aggregator-v4-decoder

Other aggregator and routing decoders: Jupiter Swap, 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 DFlow Aggregator v4 transactions from the public RPC and prints every decoded Swap instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-dflow-aggregator-v4-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_dflow_aggregator_v4_decoder::{
        instructions::DflowAggregatorV4Instruction, DflowAggregatorV4Decoder, 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(DflowAggregatorV4Decoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

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

Each Swap instruction prints one line with the transaction signature and the decoded Swap 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 DflowAggregatorV4Instruction::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 Order 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_dflow_aggregator_v4_decoder::{
        accounts::DflowAggregatorV4Account, DflowAggregatorV4Decoder, 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(DflowAggregatorV4Decoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

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

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

CloseEmptyTokenAccount#

From the program's IDL:

Closes a token account if it has a zero balance

Discriminator e84b8c88fa4ee0bc · data CloseEmptyTokenAccount · accounts CloseEmptyTokenAccountInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of CloseEmptyTokenAccountInstructionAccounts, in account order:

#FieldType
0token_accountPubkey
1authorityPubkey
2destinationPubkey
3token_programPubkey
4…remainingVec<AccountMeta>

CloseOrder#

From the program's IDL:

Closes an order, returning tokens from the order vault

Discriminator 5a67d11c073fa804 · data CloseOrder · accounts CloseOrderInstructionAccounts.

No data fields.

Required accounts: 7; extras go to remaining.

Fields of CloseOrderInstructionAccounts, in account order:

#FieldType
0orderPubkey
1order_vaultPubkey
2return_input_token_accountPubkey
3return_rent_toPubkey
4closerPubkey
5token_programPubkey
6system_programPubkey
7…remainingVec<AccountMeta>

CreateReferralTokenAccountIdempotent#

From the program's IDL:

Create a referral token account if it doesn't already exist

Discriminator 2ee829905525aaaf · data CreateReferralTokenAccountIdempotent · accounts CreateReferralTokenAccountIdempotentInstructionAccounts.

No data fields.

Required accounts: 8; extras go to remaining.

Fields of CreateReferralTokenAccountIdempotentInstructionAccounts, in account order:

#FieldType
0payerPubkey
1projectPubkey
2referral_accountPubkey
3referral_token_accountPubkey
4mintPubkey
5system_programPubkey
6token_programPubkey
7referral_programPubkey
8…remainingVec<AccountMeta>

FillOrder#

From the program's IDL:

Fills an order, closing the order after filling it

Discriminator e87a7319c78f88a2 · data FillOrder · accounts FillOrderInstructionAccounts.

FieldType
paramsFillOrderParams

Required accounts: 15; extras go to remaining.

Fields of FillOrderInstructionAccounts, in account order:

#FieldType
0orderPubkey
1order_vaultPubkey
2output_token_accountPubkey
3return_input_token_accountPubkey
4return_rent_toPubkey
5filler_input_token_accountPubkey
6input_mintOption<Pubkey>
7filler_output_token_accountPubkey
8output_mintOption<Pubkey>
9fillerPubkey
10token_programPubkey
11associated_token_programPubkey
12system_programPubkey
13event_authorityPubkey
14programPubkey
15…remainingVec<AccountMeta>

InitMarketLedgerIdempotent#

From the program's IDL:

Initialize a market ledger if it doesn't already exist

Discriminator b72b8b4f7de1239f · data InitMarketLedgerIdempotent · accounts InitMarketLedgerIdempotentInstructionAccounts.

FieldType
market_id[u8; 32]

Required accounts: 14; extras go to remaining.

Fields of InitMarketLedgerIdempotentInstructionAccounts, in account order:

#FieldType
0predictions_programPubkey
1market_ledgerPubkey
2market_ledger_redemption_vaultPubkey
3market_ledger_order_vaultPubkey
4market_ledger_reduce_yes_vaultPubkey
5market_ledger_reduce_no_vaultPubkey
6settlement_escrowPubkey
7escrow_mintPubkey
8market_yes_outcome_mintPubkey
9market_no_outcome_mintPubkey
10payerPubkey
11outcome_token_programPubkey
12escrow_token_programPubkey
13system_programPubkey
14…remainingVec<AccountMeta>

OpenOrder#

From the program's IDL:

Opens an order, escrowing the input tokens in the order vault

Discriminator ce58588f268832e0 · data OpenOrder · accounts OpenOrderInstructionAccounts.

FieldType
paramsOpenOrderParams

Required accounts: 13; extras go to remaining.

Fields of OpenOrderInstructionAccounts, in account order:

#FieldType
0orderPubkey
1order_vaultPubkey
2input_token_accountPubkey
3output_token_accountPubkey
4return_input_token_accountPubkey
5input_mintPubkey
6user_token_authorityPubkey
7fee_payerPubkey
8fee_receiverPubkey
9rent_depositorPubkey
10token_programPubkey
11system_programPubkey
12rentPubkey
13…remainingVec<AccountMeta>

Swap#

From the program's IDL:

Executes a token swap

Discriminator f8c69e91e17587c8 · data Swap · accounts SwapInstructionAccounts.

FieldType
paramsSwapParams

Required accounts: 6; extras go to remaining.

Fields of SwapInstructionAccounts, in account order:

#FieldType
0token_programPubkey
1associated_token_programPubkey
2system_programPubkey
3user_token_authorityPubkey
4event_authorityPubkey
5programPubkey
6…remainingVec<AccountMeta>

Swap2#

From the program's IDL:

Executes a token swap with a slippage fee

Discriminator 414b3f4ceb5b5b88 · data Swap2 · accounts Swap2InstructionAccounts.

FieldType
paramsSwap2Params

Required accounts: 6; extras go to remaining.

Fields of Swap2InstructionAccounts, in account order:

#FieldType
0token_programPubkey
1associated_token_programPubkey
2system_programPubkey
3user_token_authorityPubkey
4event_authorityPubkey
5programPubkey
6…remainingVec<AccountMeta>

Swap2WithDestination#

From the program's IDL:

Executes a token swap with a slippage fee. Outputs to the specified destination account.

Discriminator 5f7bd5f67a0156e7 · data Swap2WithDestination · accounts Swap2WithDestinationInstructionAccounts.

FieldType
paramsSwap2Params

Required accounts: 9; extras go to remaining.

Fields of Swap2WithDestinationInstructionAccounts, in account order:

#FieldType
0token_programPubkey
1associated_token_programPubkey
2system_programPubkey
3user_token_authorityPubkey
4destination_token_accountPubkey
5destination_token_authorityPubkey
6destination_mintPubkey
7event_authorityPubkey
8programPubkey
9…remainingVec<AccountMeta>

Swap2WithDestinationNative#

From the program's IDL:

Executes a token swap with a slippage fee. Outputs native SOL to the specified destination account by unwrapping WSOL.

Discriminator de64b892bac469a5 · data Swap2WithDestinationNative · accounts Swap2WithDestinationNativeInstructionAccounts.

FieldType
paramsSwap2Params

Required accounts: 7; extras go to remaining.

Fields of Swap2WithDestinationNativeInstructionAccounts, in account order:

#FieldType
0token_programPubkey
1associated_token_programPubkey
2system_programPubkey
3user_token_authorityPubkey
4destination_accountPubkey
5event_authorityPubkey
6programPubkey
7…remainingVec<AccountMeta>

SwapWithDestination#

From the program's IDL:

Executes a token swap. Outputs to the specified destination account.

Discriminator a8ac184dc59c8765 · data SwapWithDestination · accounts SwapWithDestinationInstructionAccounts.

FieldType
paramsSwapParams

Required accounts: 9; extras go to remaining.

Fields of SwapWithDestinationInstructionAccounts, in account order:

#FieldType
0token_programPubkey
1associated_token_programPubkey
2system_programPubkey
3user_token_authorityPubkey
4destination_token_accountPubkey
5destination_token_authorityPubkey
6destination_mintPubkey
7event_authorityPubkey
8programPubkey
9…remainingVec<AccountMeta>

SwapWithDestinationNative#

From the program's IDL:

Executes a token swap. Outputs native SOL to the specified destination account by unwrapping WSOL.

Discriminator cd4d7f6cf120c4c3 · data SwapWithDestinationNative · accounts SwapWithDestinationNativeInstructionAccounts.

FieldType
paramsSwapParams

Required accounts: 7; extras go to remaining.

Fields of SwapWithDestinationNativeInstructionAccounts, in account order:

#FieldType
0token_programPubkey
1associated_token_programPubkey
2system_programPubkey
3user_token_authorityPubkey
4destination_accountPubkey
5event_authorityPubkey
6programPubkey
7…remainingVec<AccountMeta>

TransferFee#

From the program's IDL:

Transfer an SPL token fee if the receiving account can receive it

Discriminator 81a4c415b130b4a2 · data TransferFee · accounts TransferFeeInstructionAccounts.

FieldType
amountu64

Required accounts: 6; extras go to remaining.

Fields of TransferFeeInstructionAccounts, in account order:

#FieldType
0fromPubkey
1toPubkey
2authorityPubkey
3token_programPubkey
4event_authorityPubkey
5programPubkey
6…remainingVec<AccountMeta>

TransferSol#

From the program's IDL:

Transfer native SOL from one account to another

Discriminator 4e0aecf76d75154c · data TransferSol · accounts TransferSolInstructionAccounts.

FieldType
lamportsu64

Required accounts: 3; extras go to remaining.

Fields of TransferSolInstructionAccounts, in account order:

#FieldType
0fromPubkey
1toPubkey
2system_programPubkey
3…remainingVec<AccountMeta>

TransferToSponsor#

From the program's IDL:

Transfer an SPL token to a sponsor's token account, creating the sponsor's token account if necessary.

Discriminator 9bb38297c48bfda3 · data TransferToSponsor · accounts TransferToSponsorInstructionAccounts.

FieldType
amountu64

Required accounts: 8; extras go to remaining.

Fields of TransferToSponsorInstructionAccounts, in account order:

#FieldType
0user_token_authorityPubkey
1user_token_accountPubkey
2sponsorPubkey
3sponsor_token_accountPubkey
4mintPubkey
5token_programPubkey
6associated_token_programPubkey
7system_programPubkey
8…remainingVec<AccountMeta>

UnwrapSol#

From the program's IDL:

Unwrap all SOL in the provided wrapped SOL token account

Discriminator 63280e692d6bacc9 · data UnwrapSol · accounts UnwrapSolInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of UnwrapSolInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1wrapped_sol_associated_token_accountPubkey
2token_programPubkey
3…remainingVec<AccountMeta>

WrapSol#

From the program's IDL:

Wrap SOL, creating a wrapped SOL associated token account if necessary

Discriminator 2f3e9bac83cd25c9 · data WrapSol · accounts WrapSolInstructionAccounts.

FieldType
lamportsu64

Required accounts: 6; extras go to remaining.

Fields of WrapSolInstructionAccounts, in account order:

#FieldType
0fromPubkey
1wrapped_sol_associated_token_accountPubkey
2native_mintPubkey
3token_programPubkey
4associated_token_programPubkey
5system_programPubkey
6…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 DflowAggregatorV4Account. Each wraps a boxed struct from carbon_dflow_aggregator_v4_decoder::accounts::<module>. decode_account only considers accounts owned by PROGRAM_ID and returns the first variant that matches.

Order#

Discriminator 86addfb94d561c33 · accounts::order::Order.

FieldTypeDescription
closerPubkeyAccount that is authorized to close the order
output_token_accountPubkeyAccount to which output from the fill should be sent. If the order specifies that it should output native SOL, then this should be the user's wallet, although any account is allowed. If the order doesn't specify that it should output native SOL, then this must be an SPL token account, and the token account's mint determines the order's output mint.
return_input_token_accountPubkeyAccount to which leftover tokens in the order vault should be returned when the order is filled or closed. If the input is native SOL, this should be the user's wallet, although any account is allowed. If the input is wrapped SOL or an SPL token, this must be an SPL token account for the input mint.
return_rent_toPubkeyAccount to which rent for the account should be returned when the account is closed
idu64ID used to produce a unique PDA for the order account
quoted_out_amountu64
last_fillable_slotu64Highest slot at which the order can be filled
slippage_bpsu16Max allowed slippage in basis points. Along with quoted_out_amount, this is used to calculate the minimum allowed output amount for the order.
bumpu8
vault_bumpu8Bump seed for the vault token account associated with the order
flagsu8Flags for the order
padding1u8
padding2u8
padding3u8

Events#

Variants of instructions::CpiEvent, decoded from the CpiEvent instruction. Each wraps a struct from carbon_dflow_aggregator_v4_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

Types#

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

A#

Enum types::A.

VariantFields
BC

Action#

Enum types::Action.

VariantFields
WhirlpoolsSwapWhirlpoolsSwapOptions
ClearpoolsSwapClearpoolsSwapOptions
RaydiumAmmSwapRaydiumAmmSwapOptions
LifinityV2SwapLifinityV2SwapOptions
MeteoraDlmmSwapMeteoraDlmmSwapOptions
RaydiumClmmSwapRaydiumClmmSwapOptions
RaydiumClmmSwapV2RaydiumClmmSwapV2Options
PhoenixSwapPhoenixSwapOptions
PumpFunBuyPumpFunBuyOptions
PumpFunSellPumpFunSellOptions
GammaSwapGammaSwapOptions
ObricV2SwapObricV2SwapOptions
PumpFunAmmBuyPumpFunAmmBuyOptions
PumpFunAmmSellPumpFunAmmSellOptions
SolFiSwapSolFiSwapOptions
RubiconSwapRubiconSwapOptions
MeteoraDammV1SwapMeteoraDammV1SwapOptions
RaydiumCpSwapRaydiumCpSwapOptions
StabbleStableSwapStabbleStableSwapOptions
TesseraVSwapTesseraVSwapOptions
MeteoraDammV2SwapMeteoraDammV2SwapOptions
RaydiumLaunchlabSwapRaydiumLaunchlabSwapOptions
MeteoraDbcSwapMeteoraDbcSwapOptions
HumidiFiSwapHumidiFiSwapOptions
WhirlpoolsSwapV2WhirlpoolsSwapV2Options
MeteoraDlmmSwapV2MeteoraDlmmSwapV2Options
ZeroFiSwapZeroFiSwapOptions
AlphaQSwapAlphaQSwapOptions
TokenSwapTokenSwapOptions
SolFiV2SwapSolFiV2SwapOptions
MozartSwapMozartSwapOptions
DFlowDynamicRouteV1DFlowDynamicRouteV1Options
HeavenSwapHeavenSwapOptions
NexusSwapNexusSwapOptions
SarosDlmmSwapSarosDlmmSwapOptions
TransferFeeTransferFeeOptions
TransferFeeWithMintTransferFeeOptions
RecordIdRecordIdOptions
RecordId2RecordId2Options
ManifestSwapManifestSwapOptions
BisonFiSwapBisonFiSwapOptions
SanctumInfinitySwapSanctumInfinitySwapOptions
SanctumInfinityLiquiditySanctumInfinityLiquidityOptions
OpenPredictionsOrderOpenPredictionsOrderOptions
ScorchSwapScorchSwapOptions
IncludeAccount
StabbleWeightedSwapStabbleWeightedSwapOptions
VertigoSwapVertigoSwapOptions
SetMinimumLegOutputsSetMinimumLegOutputsOptions
SetMinimumLegPricesSetMinimumLegPricesOptions
SetSponsor
WrapSolWrapSolOptions
UnwrapSol
KDEXSwapKDEXSwapOptions
DeriverseSwapDeriverseSwapOptions
VaultSwapVaultSwapOptions
MetaDaoSwapMetaDaoSwapOptions
DO
XoCashExchangeSwapXoCashExchangeSwapOptions
LemmingsFiSwapLemmingsFiSwapOptions
InitAtaIdempotent
SetMaxUnderconsumptionBpsSetMaxUnderconsumptionBpsOptions
GhostSwapGhostSwapOptions
TransferFeeV2TransferFeeOptions
TransferFeeWithMintV2TransferFeeOptions

AlphaQDynamicRouteV1Options#

Struct types::AlphaQDynamicRouteV1Options.

No fields.

AlphaQSwapOptions#

Struct types::AlphaQSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

BisonFiDynamicRouteV1Options#

Struct types::BisonFiDynamicRouteV1Options.

No fields.

BisonFiSwapOptions#

Struct types::BisonFiSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

C#

Struct types::C.

FieldType
paddingu8

ClearpoolsSwapOptions#

Struct types::ClearpoolsSwapOptions.

FieldTypeDescription
amountu64
a_to_bbool
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

DeriverseSwapOptions#

Struct types::DeriverseSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

DFlowDynamicRouteV1Options#

Struct types::DFlowDynamicRouteV1Options.

FieldTypeDescription
candidate_actionsVec<DynamicRouteV1CandidateAction>
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

DynamicRouteV1CandidateAction#

Enum types::DynamicRouteV1CandidateAction.

FeeEvent#

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

FillOrderParams#

Struct types::FillOrderParams.

FieldType
swap_actionsVec<Action>
platform_fee_ubpsu32

GammaSwapOptions#

Struct types::GammaSwapOptions.

FieldTypeDescription
amountu64
endorsedbool
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

GhostSwapOptions#

Struct types::GhostSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

HeavenSwapOptions#

Struct types::HeavenSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

HumidiFiDynamicRouteV1Options#

Struct types::HumidiFiDynamicRouteV1Options.

FieldType
swap_idu64

HumidiFiSwapOptions#

Struct types::HumidiFiSwapOptions.

FieldTypeDescription
amountu64
swap_idu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

KDEXSwapOptions#

Struct types::KDEXSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

LegPrice#

Struct types::LegPrice.

FieldType
output_atoms_per_input_tokenu64
input_mint_decimalsu8

LemmingsFiDynamicRouteV1Options#

Struct types::LemmingsFiDynamicRouteV1Options.

No fields.

LemmingsFiSwapOptions#

Struct types::LemmingsFiSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

LifinityV2SwapOptions#

Struct types::LifinityV2SwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

ManifestDynamicRouteV1Options#

Struct types::ManifestDynamicRouteV1Options.

FieldType
include_globalbool

ManifestSwapOptions#

Struct types::ManifestSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

MetaDaoSwapOptions#

Struct types::MetaDaoSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

MeteoraDammV1SwapOptions#

Struct types::MeteoraDammV1SwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

MeteoraDammV2SwapOptions#

Struct types::MeteoraDammV2SwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

MeteoraDbcSwapOptions#

Struct types::MeteoraDbcSwapOptions.

FieldTypeDescription
amountu64
is_rate_limiter_appliedbool
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

MeteoraDlmmSwapOptions#

Struct types::MeteoraDlmmSwapOptions.

FieldTypeDescription
amountu64
num_bin_arraysu8
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

MeteoraDlmmSwapV2Options#

Struct types::MeteoraDlmmSwapV2Options.

FieldTypeDescription
amountu64
num_bin_arraysu8
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

MozartDynamicRouteV1Options#

Struct types::MozartDynamicRouteV1Options.

No fields.

MozartSwapOptions#

Struct types::MozartSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

NexusDynamicRouteV1Options#

Struct types::NexusDynamicRouteV1Options.

No fields.

NexusSwapOptions#

Struct types::NexusSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

O#

Struct types::O.

FieldType
aVec<A>
amountu64
orchestrator_flagsOrchestratorFlags
pfsu16
dfsu16

ObricV2DynamicRouteV1Options#

Struct types::ObricV2DynamicRouteV1Options.

No fields.

ObricV2SwapOptions#

Struct types::ObricV2SwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

OpenOrderParams#

Struct types::OpenOrderParams.

FieldTypeDescription
input_amountu64
quoted_out_amountu64Quoted output amount after platform fee
fee_budgetu64Maximum amount in lamports that the fee payer will pay to have the order filled or closed
order_account_idu64
fillable_for_slotsu32Number of slots after the slot in which the order is opened for which the order is fillable. If zero, the order is only fillable in the slot in which the open transaction landed.
slippage_bpsu16Max allowed slippage in basis points. Along with quoted_out_amount, this is used to calculate the minimum allowed output amount.
closerPubkeyAccount that is authorized to close the order
flagsu8Flags for the order

OpenPredictionsOrderOptions#

Struct types::OpenPredictionsOrderOptions.

FieldTypeDescription
nonceu64
order_outcomeu8
quoted_out_amountu64Quoted output amount for the predictions order
slippage_bpsu16Slippage for the predictions order (separate from swap slippage)
platform_fee_recipient_vaultPubkey
platform_fee_scaleu16

OrchestratorFlags#

Struct types::OrchestratorFlags.

FieldType
flagsu8

PhoenixSwapOptions#

Struct types::PhoenixSwapOptions.

FieldTypeDescription
amountu64
sideSide
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

PumpFunAmmBuyOptions#

Struct types::PumpFunAmmBuyOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

PumpFunAmmSellOptions#

Struct types::PumpFunAmmSellOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

PumpFunBuyOptions#

Struct types::PumpFunBuyOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

PumpFunSellOptions#

Struct types::PumpFunSellOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

RaydiumAmmSwapOptions#

Struct types::RaydiumAmmSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

RaydiumClmmSwapOptions#

Struct types::RaydiumClmmSwapOptions.

FieldTypeDescription
amountu64
num_remaining_accountsu8
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

RaydiumClmmSwapV2Options#

Struct types::RaydiumClmmSwapV2Options.

FieldTypeDescription
amountu64
num_remaining_accountsu8
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

RaydiumCpSwapOptions#

Struct types::RaydiumCpSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

RaydiumLaunchlabSwapOptions#

Struct types::RaydiumLaunchlabSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

RecordId2Options#

Struct types::RecordId2Options.

FieldType
id[u8; 4]

RecordIdOptions#

Struct types::RecordIdOptions.

FieldType
id[u8; 76]

RubiconDynamicRouteV1Options#

Struct types::RubiconDynamicRouteV1Options.

No fields.

RubiconSwapOptions#

Struct types::RubiconSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

SanctumInfinityLiquidityOptions#

Struct types::SanctumInfinityLiquidityOptions.

FieldTypeDescription
amountu64
lst_value_calc_accsu8
lst_indexu32
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

SanctumInfinitySwapOptions#

Struct types::SanctumInfinitySwapOptions.

FieldTypeDescription
amountu64
src_lst_value_calc_accsu8
dst_lst_value_calc_accsu8
src_lst_indexu32
dst_lst_indexu32
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

SarosDlmmSwapOptions#

Struct types::SarosDlmmSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

ScorchSwapOptions#

Struct types::ScorchSwapOptions.

FieldTypeDescription
amountu64
idu128
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

SetMaxUnderconsumptionBpsOptions#

Struct types::SetMaxUnderconsumptionBpsOptions.

FieldType
max_underconsumption_bpsu16

SetMinimumLegOutputsOptions#

Struct types::SetMinimumLegOutputsOptions.

FieldTypeDescription
minimum_outputsVec<u64>Minimum allowed output amount for each swap leg

SetMinimumLegPricesOptions#

Struct types::SetMinimumLegPricesOptions.

FieldTypeDescription
minimum_pricesVec<LegPrice>Minimum allowed price for each swap leg

Side#

Enum types::Side.

Variant
Bid
Ask

SolFiDynamicRouteV1Options#

Struct types::SolFiDynamicRouteV1Options.

No fields.

SolFiSwapOptions#

Struct types::SolFiSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

SolFiV2DynamicRouteV1Options#

Struct types::SolFiV2DynamicRouteV1Options.

No fields.

SolFiV2SwapOptions#

Struct types::SolFiV2SwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

StabbleStableSwapOptions#

Struct types::StabbleStableSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

StabbleWeightedSwapOptions#

Struct types::StabbleWeightedSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

Swap2Params#

Struct types::Swap2Params.

FieldTypeDescription
actionsVec<Action>
quoted_out_amountu64Quoted output amount for the swap after platform fee
slippage_bpsu16Max allowed slippage in basis points. Along with quoted_out_amount, this is used to calculate the minimum allowed output amount for the swap.
platform_fee_bpsu16Platform fee in basis points. If nonzero, this percentage of the output amount will be transferred to the platform fee account, and the instruction must include the platform fee account as the last account. The platform fee account must be a valid token account for the output mint, and it must specify the public key of the Referral program's DFlow project as its owner.
positive_slippage_fee_limit_pctu8Limit on the positive slippage fee in percent. The positive slippage fee is limited to the lesser of (1) the excess actual out amount above the quoted amount and (2) this percentage of the actual out amount after platform fee.

SwapEvent#

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

SwapParams#

Struct types::SwapParams.

FieldTypeDescription
actionsVec<Action>
quoted_out_amountu64Quoted output amount for the swap after platform fee
slippage_bpsu16Max allowed slippage in basis points. Along with quoted_out_amount, this is used to calculate the minimum allowed output amount for the swap.
platform_fee_bpsu16Platform fee in basis points. If nonzero, this percentage of the output amount will be transferred to the platform fee account, and the instruction must include the platform fee account as the last account. The platform fee account must be a valid token account for the output mint, and it must specify the public key of the Referral program's DFlow project as its owner.

TesseraVDynamicRouteV1Options#

Struct types::TesseraVDynamicRouteV1Options.

No fields.

TesseraVSwapOptions#

Struct types::TesseraVSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

TokenSwapOptions#

Struct types::TokenSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

TransferFeeOptions#

Struct types::TransferFeeOptions.

FieldType
amountu64

VaultSwapOptions#

Struct types::VaultSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

VertigoSwapOptions#

Struct types::VertigoSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

WhirlpoolsSwapOptions#

Struct types::WhirlpoolsSwapOptions.

FieldTypeDescription
amountu64
a_to_bbool
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

WhirlpoolsSwapV2Options#

Struct types::WhirlpoolsSwapV2Options.

FieldTypeDescription
amountu64
a_to_bbool
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

WrapSolOptions#

Struct types::WrapSolOptions.

FieldType
lamportsu64

XoCashExchangeSwapOptions#

Struct types::XoCashExchangeSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

ZeroFiDynamicRouteV1Options#

Struct types::ZeroFiDynamicRouteV1Options.

No fields.

ZeroFiSwapOptions#

Struct types::ZeroFiSwapOptions.

FieldTypeDescription
amountu64
orchestrator_flagsOrchestratorFlagsOptional flags for the swap

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.