Skip to main content
The Router path uses the /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

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
See Common Instructions for a reference of common instructions.

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 in addressesByLookupTableAddress. 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.
  • /build does not have the required requestId
  • /build is intended for customisations, and /execute validates 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:
Your fee is added as part of the swap instruction. The 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.