Binance Web3 Connector JS
    Preparing search index...

    Interface BuildSolanaSwapInstructionsRequest

    Request parameters for buildSolanaSwapInstructions operation in TradingApi. BuildSolanaSwapInstructionsRequest

    interface BuildSolanaSwapInstructionsRequest {
        amount: string;
        autoSlippage?: BuildSolanaSwapInstructionsAutoSlippageEnum;
        binanceChainId: CT_501;
        computeUnitLimit?: string;
        computeUnitPrice?: string;
        feePercent?: string;
        fromTokenAddress: string;
        fromTokenReferrerWalletAddress?: string;
        gasLevel?: BuildSolanaSwapInstructionsGasLevelEnum;
        maxAutoSlippagePercent?: string;
        nonce?: string;
        priceImpactProtectionPercent?: string;
        quoteId: string;
        recvWindow?: number | bigint;
        slippagePercent: string;
        tips?: string;
        toTokenAddress: string;
        toTokenReferrerWalletAddress?: string;
        userWalletAddress: string;
    }
    Index
    amount: string

    Sell-token amount in the token's smallest unit (positive integer string, no decimals).

    TradingApiBuildSolanaSwapInstructions

    When "true", slippage is auto-derived from market data and overrides slippagePercent. Defaults to false.

    TradingApiBuildSolanaSwapInstructions

    binanceChainId: CT_501

    Chain identifier. Only CT_501 (Solana) is accepted; other values return CHAIN_NOT_SUPPORTED (40411).

    TradingApiBuildSolanaSwapInstructions

    computeUnitLimit?: string

    Maximum compute units the transaction may consume (analogous to EVM gasLimit). Defaults to the platform value when omitted.

    TradingApiBuildSolanaSwapInstructions

    computeUnitPrice?: string

    Priority fee per compute unit (micro-lamports). When omitted, the platform computes a value either from the gasLevel tier or from chain-side defaults.

    TradingApiBuildSolanaSwapInstructions

    feePercent?: string

    Custom fee (referral fee / Add Fee) percentage as a decimal string. Must be paired with exactly one of fromTokenReferrerWalletAddress or toTokenReferrerWalletAddress (the two referrer addresses are mutually exclusive). Same semantics as /swap.

    Range (Solana):* (0, 10] — greater than 0, up to 10 inclusive, max 2 decimal places. "1.5" means 1.5%. Values exceeding 2 decimal places are rejected with INVALID_FEE_PERCENT (40466).

    four.meme tokens are not supported* — do not pass fee parameters when either side of the pair is a four.meme token.

    TradingApiBuildSolanaSwapInstructions

    fromTokenAddress: string

    Sell-token mint address (Solana Base58, case-sensitive).

    TradingApiBuildSolanaSwapInstructions

    fromTokenReferrerWalletAddress?: string

    Wallet address that receives the fee deducted from the sell token (FROM_TOKEN direction). Mutually exclusive with toTokenReferrerWalletAddress — providing both returns CONFLICT_REFERRER_PARAMS (40468). Solana requires a Base58 pubkey; an invalid format returns INVALID_REFERRER_ADDRESS (40467). Must be paired with feePercent.

    TradingApiBuildSolanaSwapInstructions

    Priority-fee tier; consulted only when computeUnitPrice is omitted. Defaults to "average".

    TradingApiBuildSolanaSwapInstructions

    maxAutoSlippagePercent?: string

    Cap on auto-derived slippage (only applies when autoSlippage=true).

    TradingApiBuildSolanaSwapInstructions

    nonce?: string

    Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted.

    TradingApiBuildSolanaSwapInstructions

    priceImpactProtectionPercent?: string

    Maximum allowed price impact percentage (0–100). Defaults to 90; set to 100 to disable.

    TradingApiBuildSolanaSwapInstructions

    quoteId: string

    quoteId returned from /quote for the route to execute. TTL ~30s; expired entries return QUOTE_EXPIRED (40401).

    TradingApiBuildSolanaSwapInstructions

    recvWindow?: number | bigint

    Allowed time deviation in milliseconds (default: 5000, max: 60000).

    TradingApiBuildSolanaSwapInstructions

    slippagePercent: string

    Maximum slippage as a percentage. Solana range 0 to less than 100. "0.5" means 0.5%.

    TradingApiBuildSolanaSwapInstructions

    tips?: string

    Jito tips in SOL for MEV protection. Valid range [0.000000001, 2] (minimum 1 lamport). When specified, it is recommended to set computeUnitPrice=0. The platform picks one of Jito's tip accounts at random per request.

    TradingApiBuildSolanaSwapInstructions

    toTokenAddress: string

    Buy-token mint address (Solana Base58, case-sensitive).

    TradingApiBuildSolanaSwapInstructions

    toTokenReferrerWalletAddress?: string

    Wallet address that receives the fee deducted from the buy-token output (TO_TOKEN direction). Mutually exclusive with fromTokenReferrerWalletAddress — providing both returns CONFLICT_REFERRER_PARAMS (40468). Solana requires a Base58 pubkey; an invalid format returns INVALID_REFERRER_ADDRESS (40467). Must be paired with feePercent. The referrer must already be activated (funded with some SOL) or the request returns REFERRER_NOT_ACTIVATED (40469).

    TradingApiBuildSolanaSwapInstructions

    userWalletAddress: string

    User wallet address (Solana Base58); becomes the v0 transaction's feePayer.

    TradingApiBuildSolanaSwapInstructions