Skip to main content
POST
Build swap transaction

Body

application/json
userPublicKey
string
required

Wallet that signs and pays for the swap

quoteResponse
object
required

Quote returned by GET /quote. Send it back unchanged as quoteResponse.

wrapUnwrapSol
boolean
default:true

Wrap and unwrap native SOL automatically

txVersion
enum<string>
default:V0

Transaction format. Case-sensitive. LEGACY and V1 do not support JIT routes; quote with jitRouting=false to use them.

Available options:
V0,
LEGACY,
V1
priorityFee
string

A level (min, low, medium, auto, high, veryHigh, turbo, unsafeMax) or a total fee in lamports as a string, such as "50000". Default auto.

Example:

"high"

maxPriorityFee
integer

Cap on the compute unit price, in micro-lamports

computeUnitPriceMicroLamports
integer

Exact compute unit price in micro-lamports. Overrides priorityFee.

computeUnitLimit
integer

Compute unit limit

tipAccount
string

Account that receives a SOL tip, such as a Jito tip account

tipLamports
integer

Tip amount in lamports

feeAccount
string

Wallet that receives your platform fee

feeBps
integer

Platform fee in basis points

feeFromInput
boolean
default:false

Take the platform fee from the input token

chargeBps
integer

Fee on positive slippage, in basis points

jitRouting
enum<string>
default:auto

On /swap, auto keeps the quote's route. On /swap-instructions, you get a JIT swap only when this is true.

Available options:
auto,
true,
false

Response

Unsigned transaction

swapTransaction
string
required

Unsigned transaction, base64. Sign it with the user's wallet.

lastValidBlockHeight
integer
required

The transaction expires after this block height

prioritizationFeeLamports
integer
required

Priority fee included, in lamports

contextSlot
integer

Slot the transaction was built at

quoteResponse
object

The quote the transaction was built from. Show these amounts to the user if they differ from the original quote.