Skip to main content
The swap runs the same route selection as /v1/quote, then compiles the route into one transaction for the wallet you name. The server never holds keys. You sign and send.

Request

The token program is resolved from the mint. Only set an override when you already know the owning program; a wrong value fails on chain.

Response

route.out_atoms is the quoted output. route.min_out_atoms is enforced on chain. Output SOL arrives as wrapped SOL.

Transaction format

The transaction is Solana transaction format v1. It starts with the version byte 0x81, not a signature count.
@solana/web3.js 1.x and other decoders that expect legacy or v0 messages throw on it. Decode and sign with a library that understands transaction v1, such as @solana/kit 3 or later, and send the serialized bytes with any RPC’s sendTransaction. Wallets that implement the Solana Wallet Standard sign v1 transactions through their normal sign method.

Sign and send

1

Decode

Base64-decode tx_base64 into a v1 transaction.
2

Sign

Sign with the key for user_wallet. The transaction has no other signers.
3

Send

Submit the signed bytes to your RPC. Skipping preflight is safe only if you simulated yourself.
4

Confirm

Poll the signature until it is confirmed, or until the chain passes last_valid_block_height, at which point the transaction can no longer land and you should request a new swap.
Swap transactions are not simulated server side. To fail before paying a fee, simulate the signed transaction against your RPC first.

Errors

A branch that cannot be built is excluded and selection re-runs before a 500 is returned, so a 500 means no buildable route remained.