Skip to main content

Crate swaps

Crate swaps 

Source
Expand description

§swaps - solana swap instruction lib

lib for building stack-backed swap instruction views on solana DEXes. the caller drives RPC/gRPC and tx submission; swaps returns the accounts to fetch and emits the resulting instruction account/data slices.

currently supported dexes (each gated behind a cargo feature):

Re-exports§

pub use builder::AccountMeta;
pub use builder::InstructionBuf;
pub use builder::InstructionView;
pub use builder::MAX_ACCOUNTS;
pub use builder::MAX_DATA;
pub use dex::Dex;
pub use dex::DexKind;
pub use dex::fetch_plan;
pub use dex::followup_keys;
pub use error::BuildError;
pub use error::DecodeError;
pub use error::RequestError;
pub use fetch::FetchKey;
pub use fetch::FetchPlan;
pub use fetch::FetchRole;
pub use request::SwapRequest;
pub use snapshot::Snapshot;
pub use snapshot::decode_snapshot;

Modules§

addresses
amount
builder
dex
error
fetch
pda
request
snapshot
util

Functions§

build_swap
top-level dispatch: build the swap instruction into out.