The Meta-Aggregator is the recommended way to swap on Jupiter. All routing engines compete for the best price (Metis, JupiterZ RFQ, Dflow, OKX), and Jupiter handles transaction landing for you viaDocumentation Index
Fetch the complete documentation index at: https://dev.jup.ag/docs/llms.txt
Use this file to discover all available pages before exploring further.
/order + /execute.
Quick start
Three steps: get an order, sign it, execute it.Prerequisites
Loading a wallet for testing
Loading a wallet for testing
There are several ways to load a wallet for testing. All examples on this page use
BS58_PRIVATE_KEY from your .env file.Imports, types, and constants
Imports, types, and constants
Code example
How it works
1. Get an order
GET /order returns a quote and an assembled transaction in a single call. All routers compete for the best price: Metis, JupiterZ, Dflow, and OKX.
Adding optional parameters to
/order (such as fee or slippage overrides) may restrict routing. See the routing impact matrix below for details.| Parameter | Description |
|---|---|
inputMint | Mint address of the token you are selling |
outputMint | Mint address of the token you are buying |
amount | Amount in the smallest unit of the input token |
taker | Your wallet address. Required to receive an assembled transaction. Without taker, you get a quote but no transaction. This is useful for price checks. |
| Field | Description |
|---|---|
transaction | Base64-encoded transaction to sign. Null if taker is not set. |
requestId | Pass this to /execute. |
outAmount | Expected output amount before slippage. |
router | Which router won the quote (iris, jupiterz, dflow, okx). |
mode | ”ultra” (no optional params) or “manual” (optional params used). |
2. Sign the transaction
- The transaction returned by
/orderis unsigned. Sign it with your wallet’s private key. The example above uses@solana/kit. The transaction is a versioned transaction (v0). - Note: we use the
partiallySignTransactionfor partial signing because when JupiterZ routing is provided, there is an additional signer which is the MM that will be required after sending the transaction to/executerequest.
3. Execute the transaction
POST /execute takes the signed transaction and the requestId from the order response.
Jupiter handles:
- Optimised slippage via RTSE (Real-Time Slippage Estimator), applied at order time to balance trade success and price protection
- Optimised priority fee strategy for current network conditions
- Jupiter Beam (our own proprietary transaction execution pipeline) for accelerated transaction sending and landing across multiple RPC providers
- Confirmation polling
- Parses both successful and failed transactions
| Field | Required | Description |
|---|---|---|
signedTransaction | Yes | Base64-encoded signed transaction |
requestId | Yes | The requestId from the /order response |
lastValidBlockHeight | No | Block height for nonce validation |
| Field | Description |
|---|---|
status | ”Success” or “Failed” |
signature | Transaction signature (present on both success and some failures) |
code | Error code. 0 = success. See error codes below. |
inputAmountResult | Amount of input token used for the swap |
outputAmountResult | Amount of output token received |
Error codes
| Code | Category | Meaning |
|---|---|---|
0 | Success | Transaction confirmed |
-1 | Execute | Missing cached order (requestId not found or expired) |
-2 | Execute | Invalid signed transaction |
-3 | Execute | Invalid message bytes |
-1000 | Aggregator | Failed to land |
-1001 | Aggregator | Unknown error |
-1002 | Aggregator | Invalid transaction |
-1003 | Aggregator | Transaction not fully signed |
-1004 | Aggregator | Invalid block height |
-2000 | RFQ | Failed to land |
-2001 | RFQ | Unknown error |
-2002 | RFQ | Invalid payload |
-2003 | RFQ | Quote expired |
-2004 | RFQ | Swap rejected |
Routing impact matrix
Adding optional parameters to/order can restrict which routers are eligible:
| Parameter | Metis | JupiterZ (RFQ) | Dflow | OKX |
|---|---|---|---|---|
| (no optional params) | Yes | Yes | Yes | Yes |
receiver | Yes | No | Yes | Yes |
referralAccount & referralFee | Yes | No | Yes | Yes |
payer (integrator gasless) | Yes | No | No | No |
excludeRouters: jupiterz | Yes | No | Yes | Yes |
receiver, referralAccount, referralFee or payer disables JupiterZ (RFQ), which may result in worse pricing on major pairs where market makers often beat onchain routing by 5-20bps.
For the full parameter reference, see the API reference.
Order mode
The/order response includes a mode field that indicates whether optional parameters were applied that may affect routing or swap behaviour:
| Mode | Meaning |
|---|---|
| ultra | No optional params used. Default behaviour with all routers eligible. |
| manual | Optional params detected (e.g. slippageBps, referralAccount, payer). These modifications may restrict routing or change swap behaviour. |
mode does not indicate which router was used for the swap. It signals whether you adjusted parameters that could affect price or swap success. This is useful for debugging: if a swap fails in manual mode, the parameter modifications you applied may be the cause.
This is similar to how the jup.ag frontend behaves: when you use custom settings like slippage, priority fee strategy, or dex/router exclusions, the swap is handled differently. Since you opted into custom parameters, you take responsibility for the impact on swap outcomes.
Fees
Jupiter platform fee
Jupiter charges a platform fee on/order swaps. This fee is included in the quote and deducted automatically. The platformFee field in the response shows the fee amount and rate:
Total fee vs platform fee
The top-levelfeeBps field is the total fee rate charged for the swap. The platformFee.feeBps field is the Jupiter platform fee rate, which is the fee Jupiter intends to make from the swap.
These values can differ when the swap includes additional charges, such as gasless support cost recoup. For example, if the platform fee for a swap pair is 5 bps and gasless support adds 7 bps, the response can show feeBps: 12 and platformFee.feeBps: 5.
Fee breakdown
The platform fee varies by token pair:| Token Pair | Fee (bps) |
|---|---|
| Buying Jupiter tokens (SOL/Stable to JUP/JLP/jupSOL) | 0 |
| Pegged assets (LST-LST, Stable-Stable) | 0 |
| SOL-Stable | 2 |
| LST-Stable | 5 |
| Everything else | 10 |
| New tokens (within 24 hours of token age) | 50 |
Fee mint priority
Jupiter determines which token to collect fees in based on a priority list:- SOL
- Stablecoins (USDC, USDT, etc.)
- Liquid staked tokens (jupSOL, etc.)
- Bluechips (large market cap tokens)
- Others
feeBps, platformFee.feeBps, and feeMint fields in the /order response to see the total fee rate, Jupiter platform fee rate, and fee token for your swap.
Referral fees
Use the Jupiter Referral Program to earn fees on/order swaps. This requires setting up referral accounts before you can collect fees.
How it works
- Jupiter takes 20% of your integrator fee (no separate platform fee when referral is active)
- Jupiter decides which token mint to collect fees in based on the fee mint priority list
- You must create a
referralTokenAccountfor each mint you expect to receive fees in - If the
referralTokenAccountfor thefeeMintis not initialised, the order still returns but executes without your fees (the user still gets their swap) - Fee range: 50 to 255 bps
- Supports SPL and Token2022 tokens
Setup
Three one-time steps before you can collect fees:- Install the Referral SDK
- Create a
referralAccount(once)
- Create
referralTokenAccountfor each fee mint
Usage
PassreferralAccount and referralFee to /order:
feeBps is the total fee rate charged for the swap, while platformFee.feeBps is the Jupiter platform fee rate. If the response falls back to the default platform fee, the referralTokenAccount for that feeMint is likely not initialised.
Fee response fields
The/order response includes these fee-related fields:
| Field | Description |
|---|---|
feeBps | Total fee rate charged for the swap, including platform fee and additional charges such as gasless support cost recoup |
feeMint | Token fees are collected in |
platformFee.amount | Jupiter platform fee amount |
platformFee.feeBps | Jupiter platform fee rate, excluding gasless support cost recoup |
referralAccount | Referral account used (if set) |
Related
- Jupiter Referral Program for the full referral program documentation
- Advanced Techniques for gasless swaps, priority fees, and CU optimisation
- API Reference: GET /order for the full OpenAPI specification
- API Reference: POST /execute for the full OpenAPI specification
