v1 only
Every transaction the router builds is v1 (SIMD-0385, active on mainnet since slot 447,120,000). There is no v0 and no legacy form:txVersion is the integer 1 or absent, and txVersion: 0 (or any other number) and asLegacyTransaction: true answer 400. The response spells it "txVersion": "v1"; do not send that string back, it is a parse error.
Getting a transaction
The build answers instructions by default. Two ways to a transaction:- Let the router serialize it: send
"serialize": true. You getswapTransaction(base64, unsigned) andlastValidBlockHeight. The blockhash is the router’s: refreshed every 2 seconds and never served older than 30, so sign and send right away. Without a fresh one the build answers503 not_ready(blockhash unavailable). - Assemble it yourself: put
setupInstructions, then every instruction ofswapInstructions, thencleanupInstruction, thenotherInstructions, and set the header fromtransactionConfig. Or post them toPOST /tx/v1, which serializes any instructions you give it as an unsigned v1 transaction (useful to add your own instructions).
Compute budget
transactionConfig carries what goes in the v1 header:
A limit left out of a v1 header counts as zero, not as a default: keep every field the router gives you. The compute-unit limit is sized from the route’s steps (
walkSteps in the quote); if you strip walkSteps from a quoteResponse, the build declares the maximum for those hops and you pay priority fee on it.
Priority fee
The first of these that the build body sets (to a value above zero) decides the fee:
Nothing set means no priority fee: absent is not
auto, and an explicit 0 is no fee, not the market price. The fee is charged on the declared compute-unit limit, not on the units the swap ends up using. costs.priorityFeeSource says where the number came from (client, chain, floor, ceiling, none).
Tips
prioritizationFeeLamports: {"jitoTipLamports": N}(or{"jitoTipLamportsWithPayer": {"lamports": N}}) adds a System transfer ofNlamports to the Jito tip account96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5inotherInstructions, and no priority fee from that field (computeUnitPriceMicroLamportsstill applies).tipWallet+tipLamportstip any wallet you choose, and win over the Jito field.
What the user pays
costs estimates the lamports the transaction costs the user, as decimal strings (priorityFeeSource is a label and rentExact a boolean):
rentLamports counts every account the setup creates as if the user had none of them: a user who already has the token account pays less. With rentExact: false, the size of a Token-2022 account could not be known exactly and that account’s rent is counted at its minimum.