Jupiter — Swap API V2 — Prepare unsigned build Transaction
jupiter_get_swap_v2_buildGet a swap quote with raw instructions for building custom transactions. Uses the caller's OpenAny gateway credentials. Charges and authorization are determined by the gateway.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Quoting mode. "fast" trades quote optimality for reduced latency. | |
| dexes | No | - Comma-separated list of DEXes to restrict routing to. - Labels are case sensitive (`SolFi`, not `solfi`). An unrecognised label is not a validation error: it returns `400 {"error": "No routes found"}`, indistinguishable from a pair with no liquidity. - Mutually exclusive with excludeDexes. Passing both returns `400 {"error": "dexes and excludeDexes are mutually exclusive"}`. - Full list of DEXes here using the `/program-id-to-label` endpoint. | |
| payer | No | Account that pays transaction fees and rent. Defaults to taker when not passed in. | |
| taker | Yes | Public key of the user initiating the swap. | |
| amount | Yes | The amount to swap in the smallest unit of the input token | |
| inputMint | Yes | The mint address of the input token | |
| tipAmount | No | SOL tip amount in lamports. Adds a tip instruction for use with /submit. The tip payer is the taker (or payer if specified). | |
| feeAccount | No | Token account to collect platform fees. Required if platformFeeBps is positive. | |
| outputMint | Yes | The mint address of the output token | |
| maxAccounts | No | Maximum number of accounts for the swap route. Defaults to 64. | |
| slippageBps | No | Slippage tolerance in basis points. Defaults to 50. Import profile accepts the string branch only; other union branches are not exposed. | |
| excludeDexes | No | - Comma-separated list of DEXes to exclude. - Labels are case sensitive (`SolFi`, not `solfi`). - Mutually exclusive with dexes. - Full list of DEXes here using the `/program-id-to-label` endpoint. | |
| forJitoBundle | No | Set to `true` if the transaction will be submitted as part of a Jito bundle. This excludes DEXes that are incompatible with Jito bundles. | |
| platformFeeBps | No | Platform fee in basis points. If positive, feeAccount is required. | |
| wrapAndUnwrapSol | No | Whether to wrap/unwrap SOL. Defaults to true. | |
| transactionVersion | No | The Solana transaction version to build for, `"0"` or `"1"`. Defaults to `"0"`. `"1"` returns v1 instructions: `computeBudgetInstructions` is empty and `addressesByLookupTableAddress` is `{}` (v1 inlines accounts, no lookup tables). Set the compute budget, including the returned `computeUnitPrice`, on the message config. Build with a v1-capable SDK (`@solana/kit` v8 or later). | |
| blockhashSlotsToExpiry | No | Number of slots until the blockhash expires. Defaults to 150. | |
| destinationTokenAccount | No | - SPL token account to receive output tokens. - Mutually exclusive with nativeDestinationAccount. | |
| nativeDestinationAccount | No | - Native SOL account to receive output. - Mutually exclusive with destinationTokenAccount. | |
| computeUnitPricePercentile | No | Percentile of compute unit price to use. Named levels: "medium" (25th), "high" (50th), "veryHigh" (75th), or a number 0-10000 in basis points. Import profile accepts the string branch only; other union branches are not exposed. |