POST
/
swap

Body

application/json
quoteResponse
object
required

The response from the quote endpoint

userPublicKey
string
required

Base58-encoded address of the swapper's wallet

computeUnitPriceMicroLamports
integer

Compute unit price in micro-lamports

Required range: x > 0
createFeeAccount
object

If specified, the transaction will create the fee_account if it doesn't already exist. The user pays for the creation of the fee account. Ignored if fee_account is unspecified.

destinationTokenAccount
string

Base58-encoded address of the token account that will receive the output token. If not provided, the user's associated token account for the output mint will be used. If provided, the account must already be initialized.

dynamicComputeUnitLimit
boolean

If true, the server will simulate the transaction to determine its compute unit limit. If unspecified or false, the transaction will use the default compute unit limit.

feeAccount
string

Base58-encoded address of the token account that will receive the platform fee if a platform fee applies to the swap. If specified, (1) this account's mint must match the output mint for the swap, (2) the account must be initialized before the swap is executed, and (3) the account must be derived using the seeds ["referral_ata", referral_account, mint] and the Referral program ID REFER4ZgmyYx9c6He5XfaTMiGfdLwRnkV4RPp9t9iF3.

prioritizationFeeLamports
integer

Prioritization fee in lamports. Mutually exclusive with compute_unit_price_micro_lamports.

Required range: x > 0
wrapAndUnwrapSol
boolean

If false, the transaction will use wrapped SOL. This will be ignored if the output token is SOL and destination_token_account is specified, as the swap signer might not have authority to close the destination token account.

Response

200 - application/json
lastValidBlockHeight
integer
required

The last block height at which the transaction is valid

Required range: x > 0
prioritizationFeeLamports
integer
required

Prioritization fee in lamports

Required range: x > 0
swapTransaction
string
required

Base64-encoded swap transaction. The user must sign before sending it to Solana.