Build a swap
The instructions of the swap for userPublicKey, ready to assemble and sign, plus their
budget (transactionConfig) and what the transaction costs the wallet (costs). With
serialize: true the response also carries the whole unsigned v1 transaction
(swapTransaction) and lastValidBlockHeight.
Which route is built, in this order:
quoteResponse: the route of that quote, as quoted. No re-quote and no age check: build right after quoting, or the transaction may revert onminReturn.routeTicket: the signed route of a quote (only when your router setsROUTER_TICKET_SECRET).- Otherwise
inputMint+outputMint+amount(and the quote parameters): quoted now and built.
Assembling the transaction yourself: setupInstructions, then every entry of
swapInstructions (two for a split), then cleanupInstruction if present, then
otherInstructions, with transactionConfig in the v1 header (POST /tx/v1 does the
serialization). computeBudgetInstructions and addressLookupTableAddresses are always
empty: a v1 message carries its budget in the header and takes no lookup tables.
Differences from Jupiter: quoteResponse is optional; feeAccount is the fee
wallet (the router derives its token account); destinationTokenAccount is the
receiving wallet, not a token account; the transaction is v1 with no lookup tables;
extra fields swapInstructions, quoteId, buildId, shape, minReturn, maxAmountIn,
computeUnits, loadedAccountsDataSize, txVersion, transactionConfig, routePlan,
costs; no tokenLedgerInstruction, prioritizationType, simulationError or
dynamicSlippageReport; useSharedAccounts, dynamicComputeUnitLimit,
skipUserAccountsRpcCalls, dynamicSlippage, trackingAccount and blockhashSlotsToExpiry
are ignored.
Authorizations
Body
The wallet that signs and pays: fee payer, source of the input, owner of every intermediate account. Alias wallet
A quote to build as it is (no re-quote). Takes precedence over routeTicket and the pair fields
The routeTicket of a quote, instead of quoteResponse
Pair mode (no quote): the mint you spend. With a quote or ticket, if present, must match it
Pair mode: the mint you receive. With a quote or ticket, if present, must match it
Pair mode: u64 amount, as in /quote. With a ticket, if present, must match it
Pair mode only
ExactIn, ExactOut, exactIn, exactOut Overrides the slippage of the quote or ticket; pair-mode default 50. Above 10000 is taken as 10000. Must be a JSON number
Pair mode only
Pair mode only
Pair mode only. Alias includeDex
Pair mode only. Alias excludeDex
Pair mode only; a split quote is built as a split anyway
Pair mode only
Pair mode only
true: SOL input is wrapped from the wallet's lamports and its wSOL account closed after the swap; SOL output is unwrapped back to the wallet (not when destinationTokenAccount is another wallet). false: the route spends from and pays into the wallet's wSOL account. Alias unwrapSol
The integrator fee wallet (not a token account): a token-side fee goes to its associated token account, created if missing; a SOL-side fee is paid to the wallet itself. Must differ from userPublicKey. Required when the quote priced a platform fee. Alias feeWallet
The fee in basis points. Pinned quote: must equal platformFee.feeBps when the quote priced one. On a quote that priced no fee it is added at build time and lowers the floor, so up to feeBps less than the quoted outAmount can arrive. Pair mode: priced like platformFeeBps, only with feeAccount
As in /quote; must match a priced quote
The priority fee, Jupiter style. A number is the total in lamports. "auto" takes the
75th percentile of recent prioritization fees, within 10,000 and 1,000,000 micro-lamports
per compute unit. priorityLevelWithMaxLamports is auto capped at maxLamports
(priorityLevel is ignored). jitoTipLamports adds a tip transfer to a Jito tip account
instead of a priority fee. Absent means no priority fee. The fee is charged on the declared
compute-unit limit, not on the units used.
Priority price per compute unit (micro-lamports)
Older name of a total priority fee in lamports; wins over every other priority field
With tipLamports: a System transfer of the tip to this wallet, in otherInstructions. Wins over jitoTipLamports
The wallet that receives the output; the route delivers to its associated token account, created if missing. A token account here is 400 bad_recipient. Default userPublicKey. Alias recipient
0 is refused
Also return the unsigned transaction (swapTransaction) and lastValidBlockHeight
Response
The instructions (and, with serialize, the unsigned transaction)
Always empty in v1 (the budget is transactionConfig)
Before the swap: create the token accounts (idempotent), wrap SOL, initialize venue accounts
The first swap instruction (program = your deploy)
Every swap instruction in order: one, or two for a split. Sign all of them
The first account close after the swap (usually the wSOL unwrap). Absent when nothing is closed
Everything after: further closes, the tip
Always empty
32 hex digits identifying this build
exact_out: one hop with a pinned output and an input cap. A multi-hop ExactOut is token_exact_in with minReturn = the requested output
token_exact_in, native_exact_in, exact_out, token_exact_in_split ExactIn, ExactOut The floor the program enforces on the output. ExactOut: the requested output
What the route deposits. ExactOut: the slippage cap (otherAmountThreshold)
The compute-unit limit declared
The loaded-accounts byte limit declared
"v1"The v1 message header. An absent field is absent from the header; at runtime an absent limit counts as zero, so carry every field into the transaction you assemble
With serialize: true: the unsigned v1 transaction, base64. Sign it with userPublicKey
With serialize: true: last block height of its blockhash
What the transaction takes from the wallet besides the swap input, in lamports as strings