Skip to main content
POST
Guides: Quote and swap, Transactions, Platform fee. Errors: build declines.

Authorizations

x-api-key
string
header
required

Body

application/json
userPublicKey
string
required

The wallet that signs and pays: fee payer, source of the input, owner of every intermediate account. Alias wallet

quoteResponse
object

A quote to build as it is (no re-quote). Takes precedence over routeTicket and the pair fields

routeTicket
string

The routeTicket of a quote, instead of quoteResponse

inputMint
string

Pair mode (no quote): the mint you spend. With a quote or ticket, if present, must match it

outputMint
string

Pair mode: the mint you receive. With a quote or ticket, if present, must match it

amount

Pair mode: u64 amount, as in /quote. With a ticket, if present, must match it

swapMode
enum<string>
default:ExactIn

Pair mode only

Available options:
ExactIn,
ExactOut,
exactIn,
exactOut
slippageBps
integer

Overrides the slippage of the quote or ticket; pair-mode default 50. Above 10000 is taken as 10000. Must be a JSON number

maxHops
integer

Pair mode only

onlyDirectRoutes
boolean

Pair mode only

dexes

Pair mode only. Alias includeDex

excludeDexes

Pair mode only. Alias excludeDex

allowSplit
boolean
default:false

Pair mode only; a split quote is built as a split anyway

forJitoBundle
boolean
default:false

Pair mode only

reserveKeys
integer
default:0

Pair mode only

wrapAndUnwrapSol
boolean
default:true

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

feeAccount
string

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

feeBps
integer

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

feeOnInput
boolean

As in /quote; must match a priced quote

prioritizationFeeLamports

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.

computeUnitPriceMicroLamports
integer

Priority price per compute unit (micro-lamports)

transactionsFeeLamports
integer

Older name of a total priority fee in lamports; wins over every other priority field

tipWallet
string

With tipLamports: a System transfer of the tip to this wallet, in otherInstructions. Wins over jitoTipLamports

tipLamports
integer
destinationTokenAccount
string

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

txVersion
integer
default:1

0 is refused

asLegacyTransaction
boolean
serialize
boolean
default:false

Also return the unsigned transaction (swapTransaction) and lastValidBlockHeight

Response

The instructions (and, with serialize, the unsigned transaction)

computeBudgetInstructions
object[]

Always empty in v1 (the budget is transactionConfig)

setupInstructions
object[]

Before the swap: create the token accounts (idempotent), wrap SOL, initialize venue accounts

swapInstruction
object

The first swap instruction (program = your deploy)

swapInstructions
object[]

Every swap instruction in order: one, or two for a split. Sign all of them

cleanupInstruction
object

The first account close after the swap (usually the wSOL unwrap). Absent when nothing is closed

otherInstructions
object[]

Everything after: further closes, the tip

addressLookupTableAddresses
string[]

Always empty

quoteId
string
buildId
string

32 hex digits identifying this build

shape
enum<string>

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

Available options:
token_exact_in,
native_exact_in,
exact_out,
token_exact_in_split
inAmount
string
outAmount
string
otherAmountThreshold
string
swapMode
enum<string>
Available options:
ExactIn,
ExactOut
minReturn
integer

The floor the program enforces on the output. ExactOut: the requested output

maxAmountIn
integer

What the route deposits. ExactOut: the slippage cap (otherAmountThreshold)

computeUnits
integer

The compute-unit limit declared

loadedAccountsDataSize
integer

The loaded-accounts byte limit declared

txVersion
string
Allowed value: "v1"
transactionConfig
object

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

swapTransaction
string

With serialize: true: the unsigned v1 transaction, base64. Sign it with userPublicKey

lastValidBlockHeight
integer

With serialize: true: last block height of its blockhash

routePlan
object[]
costs
object

What the transaction takes from the wallet besides the swap input, in lamports as strings