Get swap instructions for Solana that allow you to build custom transactions with your own instructions (e.g., Jito tips, fee transfers).
chainId (required) — The blockchain identifier. Must be solana or solana:solanatokenIn (required) — Address of the token to swap from (use So11111111111111111111111111111111111111111 for native SOL)tokenOut (required) — Address of the token to swap to (use So11111111111111111111111111111111111111111 for native SOL)amount (required if amountRaw not provided) — Human-readable amount of tokenIn to swap (e.g., "1.5" for 1.5 tokens)amountRaw (required if amount not provided) — Raw amount as a string (e.g., "1500000000" for 1.5 SOL with 9 decimals)walletAddress (required) — Wallet address that will execute the swapslippage (optional) — Maximum acceptable slippage percentage (0-100). Default: 1excludedProtocols (optional) — Comma-separated list of factory addresses to exclude from routingonlyProtocols (optional) — Comma-separated list of tradable pool types to restrict routingpoolAddress (optional) — Specific pool address to use for the swappriorityFee (optional) — Priority fee configuration. Can be auto, a preset (low, medium, high, veryHigh), or a number in microLamports per CUcomputeUnitLimit (optional) — Compute unit limit. Can be true for dynamic or a specific number. Default: 400,000jitoTipLamports (optional) — Jito tip amount in lamports for block engine priorityfeePercentage (optional) — Fee percentage to charge on the swap (0.01 to 99). Fee is always taken from native SOL (deducted from the swap amount). At least one side of the swap must be native SOL. Must be used together with feeWallet.feeWallet (optional) — Wallet address to receive fees. Required when feePercentage is set.feeWallet via a SystemProgram.transfer instruction.
amountOutTokens (string, optional) — Estimated output amount in tokensslippagePercentage (number, optional) — Slippage percentagetokenIn (object, optional) — Input token metadata
address (string) — Token contract addressname (string, optional) — Token namesymbol (string, optional) — Token symboldecimals (number) — Token decimalslogo (string | null, optional) — Token logo URLtokenOut (object, optional) — Output token metadatarequestId (string) — Unique identifier for tracking this requestsolana (object) — Solana instructions container
instructions (object) — All instructions needed for the swap
computeBudgetInstructions (array, optional) — Instructions to set compute budgetsetupInstructions (array, optional) — Setup instructions (e.g., create token accounts)swapInstructions (array) — The swap instructions (can be multiple for multi-hop routes)cleanupInstructions (array, optional) — Cleanup instructions (e.g., close token accounts)addressLookupTableAddresses (array, optional) — ALT addresses for versioned transactionslastValidBlockHeight (number) — The last block height at which the blockhash is validrecentBlockhash (string) — Recent blockhash to use when building the transactionprogramId (string) — The program that will process this instructionaccounts (array) — Account keys involved in the instruction
pubkey (string) — Account public keyisSigner (boolean) — Whether the account must signisWritable (boolean) — Whether the account is writabledata (string) — Instruction data as base64 encoded stringrecentBlockhash and lastValidBlockHeight have a limited validity window (~150 blocks / ~1 minute). Build and send your transaction quickly.addressLookupTableAddresses is provided.requestId for troubleshooting with Mobula support| Feature | /swap/quoting | /swap/quoting-instructions |
|---|---|---|
| Returns | Serialized transaction | Individual instructions |
| Custom instructions | Need to deserialize | Direct insertion |
| Latency | Lower (ready to sign) | Slightly higher (need to build) |
| Flexibility | Limited | Full control |
| Chain support | Solana + EVM | Solana only |
| Use case | Simple swaps | Advanced integrations |
111