/build endpoint to return raw swap instructions instead of an assembled transaction. Routing is handled by Metis, Jupiter’s onchain routing engine, which finds the best path across Solana DEXes.
You build the transaction yourself, giving you full control to add custom instructions, CPI, or modify any part of the transaction. Once built and signed, submit via your own RPC or use /submit to land through Jupiter’s transaction infrastructure with SOL tips.
Quick start
Prerequisites
Imports, types, and helpers
Imports, types, and helpers
Code example
How it works
1. Call /build
GET /build returns a quote and all the instructions you need to build a swap transaction.
Required parameters:
Key response fields:
Each instruction follows this structure:
2. Add your own instructions
Insert custom instructions alongside the swap instructions. Common examples:- SOL transfer (tip or payment)
- Memo instruction
- Create or close token accounts
- Custom program CPI
3. Simulate compute unit limit
The/build response includes computeBudgetInstructions with the compute unit price but not the compute unit limit. You need to simulate the transaction to determine the correct limit.
Why: integrators using /build typically add their own instructions, so the CU usage will differ from the base swap. The simulation gives you the actual CU consumed, and you set the limit to 1.2x that value (capped at 1,400,000).
Both code examples above demonstrate this: simulate with max CU limit, then rebuild with 1.2x the simulated value plus the CU price from the response. See Solana fee structure for more on compute units and Estimate Compute Units for a standalone guide.
4. Build a v0 transaction
The response includes address lookup tables inaddressesByLookupTableAddress. Use these to compile a v0 (versioned) transaction, which supports more accounts than legacy transactions.
5. Sign and send
Sign the transaction with your wallet and send via your own RPC, or use/submit to land them through Jupiter’s transaction infrastructure with SOL tips.
/build transactions cannot use /execute./builddoes not have the requiredrequestId/buildis intended for customisations, and/executevalidates the transaction to prevent any changes
Router vs Meta-Aggregator
Optional parameters
For the full parameter reference, see the API reference.
Fees
Jupiter does not charge swap fees on/build. The only fee mechanism is integrator platform fees via platformFeeBps and feeAccount:
feeAccount can be any SPL token account you control (it does not need to be a referral program account). You are responsible for creating and managing this account.
Related
- Transaction Submission to submit via Jupiter’s transaction landing infrastructure with SOL tips for priority processing
- Common Instructions for common instructions to compose with your swap
- Advanced Techniques for CU simulation,
mode: "fast", andmaxAccounts - API Reference: GET /build for the full OpenAPI specification
