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.
| Crate | carbon-dflow-aggregator-v4-decoder 2.0.0 |
| Install | cargo add carbon-dflow-aggregator-v4-decoder@2. |
| Program ID | DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH (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-dflow-aggregator-v4-decoder/2.0.0 |
| Source | decoders/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:
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/fulluse {
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(())
}
}RUST_LOG=info cargo runEach 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:: (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 Order 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_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(())
}
}RUST_LOG=info cargo runEach 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::, 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
DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH. - 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.
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:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | authority | Pubkey |
| 2 | destination | Pubkey |
| 3 | token_ | Pubkey |
| 4… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | order | Pubkey |
| 1 | order_vault | Pubkey |
| 2 | return_ | Pubkey |
| 3 | return_ | Pubkey |
| 4 | closer | Pubkey |
| 5 | token_ | Pubkey |
| 6 | system_ | Pubkey |
| 7… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | payer | Pubkey |
| 1 | project | Pubkey |
| 2 | referral_ | Pubkey |
| 3 | referral_ | Pubkey |
| 4 | mint | Pubkey |
| 5 | system_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | referral_ | Pubkey |
| 8… | remaining | Vec< |
FillOrder#
From the program's IDL:
Fills an order, closing the order after filling it
Discriminator e87a7319c78f88a2 · data FillOrder · accounts FillOrderInstructionAccounts.
| Field | Type |
|---|---|
params | FillOrderParams |
Required accounts: 15; extras go to remaining.
Fields of FillOrderInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | order | Pubkey |
| 1 | order_vault | Pubkey |
| 2 | output_ | Pubkey |
| 3 | return_ | Pubkey |
| 4 | return_ | Pubkey |
| 5 | filler_ | Pubkey |
| 6 | input_mint | Option< |
| 7 | filler_ | Pubkey |
| 8 | output_mint | Option< |
| 9 | filler | Pubkey |
| 10 | token_ | Pubkey |
| 11 | associated_ | Pubkey |
| 12 | system_ | Pubkey |
| 13 | event_ | Pubkey |
| 14 | program | Pubkey |
| 15… | remaining | Vec< |
InitMarketLedgerIdempotent#
From the program's IDL:
Initialize a market ledger if it doesn't already exist
Discriminator b72b8b4f7de1239f · data InitMarketLedgerIdempotent · accounts InitMarketLedgerIdempotentInstructionAccounts.
| Field | Type |
|---|---|
market_id | [u8; 32] |
Required accounts: 14; extras go to remaining.
Fields of InitMarketLedgerIdempotentInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | predictions_ | Pubkey |
| 1 | market_ | Pubkey |
| 2 | market_ | Pubkey |
| 3 | market_ | Pubkey |
| 4 | market_ | Pubkey |
| 5 | market_ | Pubkey |
| 6 | settlement_ | Pubkey |
| 7 | escrow_mint | Pubkey |
| 8 | market_ | Pubkey |
| 9 | market_ | Pubkey |
| 10 | payer | Pubkey |
| 11 | outcome_ | Pubkey |
| 12 | escrow_ | Pubkey |
| 13 | system_ | Pubkey |
| 14… | remaining | Vec< |
OpenOrder#
From the program's IDL:
Opens an order, escrowing the input tokens in the order vault
Discriminator ce58588f268832e0 · data OpenOrder · accounts OpenOrderInstructionAccounts.
| Field | Type |
|---|---|
params | OpenOrderParams |
Required accounts: 13; extras go to remaining.
Fields of OpenOrderInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | order | Pubkey |
| 1 | order_vault | Pubkey |
| 2 | input_ | Pubkey |
| 3 | output_ | Pubkey |
| 4 | return_ | Pubkey |
| 5 | input_mint | Pubkey |
| 6 | user_ | Pubkey |
| 7 | fee_payer | Pubkey |
| 8 | fee_ | Pubkey |
| 9 | rent_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | system_ | Pubkey |
| 12 | rent | Pubkey |
| 13… | remaining | Vec< |
Swap#
From the program's IDL:
Executes a token swap
Discriminator f8c69e91e17587c8 · data Swap · accounts SwapInstructionAccounts.
| Field | Type |
|---|---|
params | SwapParams |
Required accounts: 6; extras go to remaining.
Fields of SwapInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | associated_ | Pubkey |
| 2 | system_ | Pubkey |
| 3 | user_ | Pubkey |
| 4 | event_ | Pubkey |
| 5 | program | Pubkey |
| 6… | remaining | Vec< |
Swap2#
From the program's IDL:
Executes a token swap with a slippage fee
Discriminator 414b3f4ceb5b5b88 · data Swap2 · accounts Swap2InstructionAccounts.
| Field | Type |
|---|---|
params | Swap2Params |
Required accounts: 6; extras go to remaining.
Fields of Swap2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | associated_ | Pubkey |
| 2 | system_ | Pubkey |
| 3 | user_ | Pubkey |
| 4 | event_ | Pubkey |
| 5 | program | Pubkey |
| 6… | remaining | Vec< |
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.
| Field | Type |
|---|---|
params | Swap2Params |
Required accounts: 9; extras go to remaining.
Fields of Swap2WithDestinationInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | associated_ | Pubkey |
| 2 | system_ | Pubkey |
| 3 | user_ | Pubkey |
| 4 | destination_ | Pubkey |
| 5 | destination_ | Pubkey |
| 6 | destination_ | Pubkey |
| 7 | event_ | Pubkey |
| 8 | program | Pubkey |
| 9… | remaining | Vec< |
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.
| Field | Type |
|---|---|
params | Swap2Params |
Required accounts: 7; extras go to remaining.
Fields of Swap2WithDestinationNativeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | associated_ | Pubkey |
| 2 | system_ | Pubkey |
| 3 | user_ | Pubkey |
| 4 | destination_ | Pubkey |
| 5 | event_ | Pubkey |
| 6 | program | Pubkey |
| 7… | remaining | Vec< |
SwapWithDestination#
From the program's IDL:
Executes a token swap. Outputs to the specified destination account.
Discriminator a8ac184dc59c8765 · data SwapWithDestination · accounts SwapWithDestinationInstructionAccounts.
| Field | Type |
|---|---|
params | SwapParams |
Required accounts: 9; extras go to remaining.
Fields of SwapWithDestinationInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | associated_ | Pubkey |
| 2 | system_ | Pubkey |
| 3 | user_ | Pubkey |
| 4 | destination_ | Pubkey |
| 5 | destination_ | Pubkey |
| 6 | destination_ | Pubkey |
| 7 | event_ | Pubkey |
| 8 | program | Pubkey |
| 9… | remaining | Vec< |
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.
| Field | Type |
|---|---|
params | SwapParams |
Required accounts: 7; extras go to remaining.
Fields of SwapWithDestinationNativeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | associated_ | Pubkey |
| 2 | system_ | Pubkey |
| 3 | user_ | Pubkey |
| 4 | destination_ | Pubkey |
| 5 | event_ | Pubkey |
| 6 | program | Pubkey |
| 7… | remaining | Vec< |
TransferFee#
From the program's IDL:
Transfer an SPL token fee if the receiving account can receive it
Discriminator 81a4c415b130b4a2 · data TransferFee · accounts TransferFeeInstructionAccounts.
| Field | Type |
|---|---|
amount | u64 |
Required accounts: 6; extras go to remaining.
Fields of TransferFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | from | Pubkey |
| 1 | to | Pubkey |
| 2 | authority | Pubkey |
| 3 | token_ | Pubkey |
| 4 | event_ | Pubkey |
| 5 | program | Pubkey |
| 6… | remaining | Vec< |
TransferSol#
From the program's IDL:
Transfer native SOL from one account to another
Discriminator 4e0aecf76d75154c · data TransferSol · accounts TransferSolInstructionAccounts.
| Field | Type |
|---|---|
lamports | u64 |
Required accounts: 3; extras go to remaining.
Fields of TransferSolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | from | Pubkey |
| 1 | to | Pubkey |
| 2 | system_ | Pubkey |
| 3… | remaining | Vec< |
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.
| Field | Type |
|---|---|
amount | u64 |
Required accounts: 8; extras go to remaining.
Fields of TransferToSponsorInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | user_ | Pubkey |
| 1 | user_ | Pubkey |
| 2 | sponsor | Pubkey |
| 3 | sponsor_ | Pubkey |
| 4 | mint | Pubkey |
| 5 | token_ | Pubkey |
| 6 | associated_ | Pubkey |
| 7 | system_ | Pubkey |
| 8… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | wrapped_ | Pubkey |
| 2 | token_ | Pubkey |
| 3… | remaining | Vec< |
WrapSol#
From the program's IDL:
Wrap SOL, creating a wrapped SOL associated token account if necessary
Discriminator 2f3e9bac83cd25c9 · data WrapSol · accounts WrapSolInstructionAccounts.
| Field | Type |
|---|---|
lamports | u64 |
Required accounts: 6; extras go to remaining.
Fields of WrapSolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | from | Pubkey |
| 1 | wrapped_ | Pubkey |
| 2 | native_mint | Pubkey |
| 3 | token_ | Pubkey |
| 4 | associated_ | Pubkey |
| 5 | system_ | Pubkey |
| 6… | 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 DflowAggregatorV4Account. Each wraps a boxed struct from carbon_. decode_ only considers accounts owned by PROGRAM_ID and returns the first variant that matches.
Order#
Discriminator 86addfb94d561c33 · accounts::.
| Field | Type | Description |
|---|---|---|
closer | Pubkey | Account that is authorized to close the order |
output_ | Pubkey | Account 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_ | Pubkey | Account 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_ | Pubkey | Account to which rent for the account should be returned when the account is closed |
id | u64 | ID used to produce a unique PDA for the order account |
quoted_ | u64 | |
last_ | u64 | Highest slot at which the order can be filled |
slippage_ | u16 | Max allowed slippage in basis points. Along with quoted_, this is used to calculate the minimum allowed output amount for the order. |
bump | u8 | |
vault_bump | u8 | Bump seed for the vault token account associated with the order |
flags | u8 | Flags for the order |
padding1 | u8 | |
padding2 | u8 | |
padding3 | u8 |
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 |
Types#
Types used by the instructions, accounts and events above, exported from carbon_.
A#
Enum types::A.
| Variant | Fields |
|---|---|
B | C |
Action#
Enum types::.
AlphaQDynamicRouteV1Options#
Struct types::.
No fields.
AlphaQSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
BisonFiDynamicRouteV1Options#
Struct types::.
No fields.
BisonFiSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
C#
Struct types::C.
| Field | Type |
|---|---|
padding | u8 |
ClearpoolsSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
a_to_b | bool | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
DeriverseSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
DFlowDynamicRouteV1Options#
Struct types::.
| Field | Type | Description |
|---|---|---|
candidate_ | Vec< | |
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
DynamicRouteV1CandidateAction#
Enum types::.
| Variant | Fields |
|---|---|
SolFi | SolFiDynamicRouteV1Options |
Rubicon | RubiconDynamicRouteV1Options |
TesseraV | TesseraVDynamicRouteV1Options |
HumidiFi | HumidiFiDynamicRouteV1Options |
SolFiV2 | SolFiV2DynamicRouteV1Options |
Mozart | MozartDynamicRouteV1Options |
ObricV2 | ObricV2DynamicRouteV1Options |
Nexus | NexusDynamicRouteV1Options |
BisonFi | BisonFiDynamicRouteV1Options |
ZeroFi | ZeroFiDynamicRouteV1Options |
Manifest | ManifestDynamicRouteV1Options |
AlphaQ | AlphaQDynamicRouteV1Options |
LemmingsFi | LemmingsFiDynamicRouteV1Options |
FeeEvent#
Struct types::. Same fields as the FeeEvent event.
FillOrderParams#
Struct types::.
| Field | Type |
|---|---|
swap_ | Vec<Action> |
platform_ | u32 |
GammaSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
endorsed | bool | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
GhostSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
HeavenSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
HumidiFiDynamicRouteV1Options#
Struct types::.
| Field | Type |
|---|---|
swap_id | u64 |
HumidiFiSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
swap_id | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
KDEXSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
LegPrice#
Struct types::.
| Field | Type |
|---|---|
output_ | u64 |
input_ | u8 |
LemmingsFiDynamicRouteV1Options#
Struct types::.
No fields.
LemmingsFiSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
LifinityV2SwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
ManifestDynamicRouteV1Options#
Struct types::.
| Field | Type |
|---|---|
include_ | bool |
ManifestSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
MetaDaoSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
MeteoraDammV1SwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
MeteoraDammV2SwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
MeteoraDbcSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
is_ | bool | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
MeteoraDlmmSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
num_ | u8 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
MeteoraDlmmSwapV2Options#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
num_ | u8 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
MozartDynamicRouteV1Options#
Struct types::.
No fields.
MozartSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
NexusDynamicRouteV1Options#
Struct types::.
No fields.
NexusSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
O#
Struct types::O.
| Field | Type |
|---|---|
a | Vec<A> |
amount | u64 |
orchestrator_ | OrchestratorFlags |
pfs | u16 |
dfs | u16 |
ObricV2DynamicRouteV1Options#
Struct types::.
No fields.
ObricV2SwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
OpenOrderParams#
Struct types::.
| Field | Type | Description |
|---|---|---|
input_ | u64 | |
quoted_ | u64 | Quoted output amount after platform fee |
fee_budget | u64 | Maximum amount in lamports that the fee payer will pay to have the order filled or closed |
order_ | u64 | |
fillable_ | u32 | Number 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_ | u16 | Max allowed slippage in basis points. Along with quoted_, this is used to calculate the minimum allowed output amount. |
closer | Pubkey | Account that is authorized to close the order |
flags | u8 | Flags for the order |
OpenPredictionsOrderOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
nonce | u64 | |
order_ | u8 | |
quoted_ | u64 | Quoted output amount for the predictions order |
slippage_ | u16 | Slippage for the predictions order (separate from swap slippage) |
platform_ | Pubkey | |
platform_ | u16 |
OrchestratorFlags#
Struct types::.
| Field | Type |
|---|---|
flags | u8 |
PhoenixSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
side | Side | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
PumpFunAmmBuyOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
PumpFunAmmSellOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
PumpFunBuyOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
PumpFunSellOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
RaydiumAmmSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
RaydiumClmmSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
num_ | u8 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
RaydiumClmmSwapV2Options#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
num_ | u8 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
RaydiumCpSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
RaydiumLaunchlabSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
RecordId2Options#
Struct types::.
| Field | Type |
|---|---|
id | [u8; 4] |
RecordIdOptions#
Struct types::.
| Field | Type |
|---|---|
id | [u8; 76] |
RubiconDynamicRouteV1Options#
Struct types::.
No fields.
RubiconSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
SanctumInfinityLiquidityOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
lst_ | u8 | |
lst_index | u32 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
SanctumInfinitySwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
src_ | u8 | |
dst_ | u8 | |
src_ | u32 | |
dst_ | u32 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
SarosDlmmSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
ScorchSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
id | u128 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
SetMaxUnderconsumptionBpsOptions#
Struct types::.
| Field | Type |
|---|---|
max_ | u16 |
SetMinimumLegOutputsOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
minimum_ | Vec<u64> | Minimum allowed output amount for each swap leg |
SetMinimumLegPricesOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
minimum_ | Vec< | Minimum allowed price for each swap leg |
Side#
Enum types::Side.
| Variant |
|---|
Bid |
Ask |
SolFiDynamicRouteV1Options#
Struct types::.
No fields.
SolFiSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
SolFiV2DynamicRouteV1Options#
Struct types::.
No fields.
SolFiV2SwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
StabbleStableSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
StabbleWeightedSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
Swap2Params#
Struct types::.
| Field | Type | Description |
|---|---|---|
actions | Vec<Action> | |
quoted_ | u64 | Quoted output amount for the swap after platform fee |
slippage_ | u16 | Max allowed slippage in basis points. Along with quoted_, this is used to calculate the minimum allowed output amount for the swap. |
platform_ | u16 | Platform 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_ | u8 | Limit 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::. Same fields as the SwapEvent event.
SwapParams#
Struct types::.
| Field | Type | Description |
|---|---|---|
actions | Vec<Action> | |
quoted_ | u64 | Quoted output amount for the swap after platform fee |
slippage_ | u16 | Max allowed slippage in basis points. Along with quoted_, this is used to calculate the minimum allowed output amount for the swap. |
platform_ | u16 | Platform 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::.
No fields.
TesseraVSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
TokenSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
TransferFeeOptions#
Struct types::.
| Field | Type |
|---|---|
amount | u64 |
VaultSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
VertigoSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
WhirlpoolsSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
a_to_b | bool | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
WhirlpoolsSwapV2Options#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
a_to_b | bool | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
WrapSolOptions#
Struct types::.
| Field | Type |
|---|---|
lamports | u64 |
XoCashExchangeSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |
ZeroFiDynamicRouteV1Options#
Struct types::.
No fields.
ZeroFiSwapOptions#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount | u64 | |
orchestrator_ | OrchestratorFlags | Optional flags for the swap |