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):
dex::pumpfun- PumpFun bonding curve (feature = "pumpfun")dex::pumpswap- PumpFun AMM, post-graduation (feature = "pumpswap")dex::raydium_amm_v4- Classic Raydium AMM v4 + OpenBook market (feature = "raydium-amm-v4")dex::raydium_clmm- Raydium concentrated liquidity market maker (feature = "raydium-clmm")dex::raydium_cpmm- Raydium constant product market maker (feature = "raydium-cpmm")dex::raydium_launchpad- Raydium Launchpad exact-input pools (feature = "raydium-launchpad")dex::orca_whirlpool- Orca concentrated liquidity Whirlpool swaps (feature = "orca-whirlpool")dex::meteora_pools- Meteora DAMM v1 / dynamic pools (feature = "meteora-pools")dex::meteora_damm_v2- Meteora DAMM v2 constant-product pools (feature = "meteora-damm-v2")dex::meteora_dlmm- Meteora DLMM LB pair swaps (feature = "meteora-dlmm")dex::meteora_dbc- Meteora Dynamic Bonding Curve virtual pool swaps (feature = "meteora-dbc")dex::bonkswap- Bonkswap v1 AMM (feature = "bonkswap")dex::humidifi- HumidiFi obfuscated pool swaps (feature = "humidifi")dex::stable_swap- Stabble stable swap pools (feature = "stable-swap")dex::stabble_weighted_swap- Stabble weighted swap pools (feature = "stabble-weighted-swap")dex::solfi_v2- SolFi V2 PMM market swaps (feature = "solfi-v2")dex::pancakeswap- PancakeSwap concentrated liquidity swaps (feature = "pancakeswap")dex::byreal- Byreal concentrated liquidity swaps (feature = "byreal")dex::fusion_amm- Fusion AMM concentrated liquidity swaps (feature = "fusion-amm")dex::goosefx_gamma- GooseFX Gamma dynamic-fee AMM swaps (feature = "goosefx-gamma")dex::jupiter_perps- Jupiter Perpetuals pool swaps (feature = "jupiter-perps")dex::tessera_v1- Tessera V PMM market swaps (feature = "tessera-v1")dex::obric- Obric Swap2 PMM trading-pair swaps (feature = "obric")dex::bisonfi- BisonFi PMM pool swaps (feature = "bisonfi")dex::scorch- Scorch routed pair swaps (feature = "scorch")
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§
Functions§
- build_
swap - top-level dispatch: build the swap instruction into
out.