Jupag

Jupag routing compares eligible engines to select a Solana swap route

last updated

Jupag routing compares eligible liquidity engines to price a requested token swap on the Solana network. In Jupiter's managed Meta-Aggregator, Metis, JupiterZ, Dflow, and OKX compete when the request permits them. The returned quote identifies the winning engine, while the assembled transaction still needs signing and execution. Eligibility changes with settings: a separate fee payer can narrow the choice to Metis. The Router path also uses Metis alone, giving integrations raw instructions for custom transactions. Understanding which path produced a quote explains the available liquidity, permitted modifications, and conditions that separate an offered price from a completed swap.

The short version: In Swap API v2, setting a payer different from the trading wallet restricts Meta-Aggregator routing to Metis.

From an assembled order to confirmed execution

The managed path combines a quote and an assembled transaction in an order response, then accepts the signed transaction for execution. The router field identifies the winning engine. An empty transaction string means the engine found pricing but could not construct a usable transaction. The integration must address the reported build error before another execution attempt. Match errorCode with router , because identical numbers can describe different failures across engines.

Execution has its own result. The /execute request carries the signed transaction and its original requestId . A successful response reports status: Success and code: 0 , meaning confirmation. A signature can also appear on a failed response, so its presence alone does not establish success. Signing authorizes the transaction; it does not establish that the swap completed.


Which engines compete in Swap API v2?

Metis, JupiterZ, Dflow, and OKX can compete through the unrestricted Meta-Aggregator path in Swap API v2. Metis searches onchain liquidity. Metis supports multi-hop and multi-split swaps across Solana decentralized exchanges. Multiple hops connect pools through intermediate tokens, while splitting distributes a swap across liquidity paths. Those options expand the combinations that its routing engine can evaluate.

JupiterZ uses request for quote (RFQ), where market makers compete with offers backed by offchain liquidity. Dflow supplies third-party onchain routing, and OKX contributes third-party liquidity.

Illustration: Jupag routing: Which engines compete in Swap API v2?

Open full-size image

A Metis route can involve several underlying pools. Jupiter also sidelines underperforming routing sources through its selection mechanism. The eligible set therefore describes which engines can compete, without promising that each engine supplies a usable offer for every request.


Why do custom settings change the eligible routes?

Custom settings change the requirements that a routing engine must satisfy, so some configurations narrow the competing engines. In Swap API v2, setting payer to a wallet different from taker restricts Meta-Aggregator routing to Metis. This option lets an integration sponsor transaction costs, while removing JupiterZ, Dflow, and OKX from that request's eligible set. A quote under this configuration reflects the remaining engine's liquidity, even when the selected token pair stays unchanged.

Visual outline: Why do custom settings change the eligible routes? (Jupag routing)

Open full-size image

On the managed path, an integrator-sponsored order needs the taker and payer signatures plus referralAccount and referralFee . Automatic Jupiter sponsorship and JupiterZ market-maker payment use other arrangements. A gasless flag alone does not identify the sponsor.

When does a routing quote expire?

JupiterZ quotes expire at expireAt , while Metis, Dflow, and OKX transactions become invalid after lastValidBlockHeight . A price move can still cause slippage failure within the applicable window. Submitting promptly reduces quote staleness without guaranteeing execution. Limit orders and DCA also use Jupiter routing when they execute, but their trigger conditions and schedules govern a different stage from a live swap quote.

Jupag routing: When does a routing quote expire?

Open full-size image


Wallet support sets the transaction version ceiling in Swap API v2

Consider a hypothetical integration comparing the same token pair and amount across two wallets. Assume its SDK and RPC support v1. One wallet can sign both v0 and v1 transactions; the other supports only v0.

With the compatible wallet, the integration requests maxSupportedTransactionVersion=1 on /order . That parameter sets a ceiling. The response contains v1 only when Metis wins and the order is not gasless; another engine or gasless handling produces v0.

For the v0-only wallet, the integration keeps the documented ceiling of 0 , or requests a new order with that ceiling after discovering missing v1 support. A successfully built order then uses the supported v0 format. The response can still select an engine that the remaining settings allow.

Before signing, the integration reads transactionVersion and decodes the returned message in that format. Comparing the decoded version with the wallet's actual signing support checks compatibility independently of the requested ceiling. Later, the execution response establishes whether the swap succeeded; a compatible format alone establishes no trading outcome.


Quoted output and wallet proceeds use different fields

The order's outAmount expresses expected output before slippage, while the execution response distinguishes swap-route amounts from amounts reflected in the wallet. When the fee uses the output token, outputAmountResult records the route's output before that fee. The totalOutputAmount field records the wallet's final output after it. Subtracting the latter from the former isolates the fee collected in that token.

An input-token fee changes the other side of the accounting. Here, totalInputAmount includes the fee deducted from the wallet, while inputAmountResult covers the amount entering the route. Their difference gives the input-token fee. The order's feeMint identifies which token carries the charge, so these relationships apply to their respective fee collection cases.

Route amounts describe execution through liquidity; wallet totals describe the swap token amounts deducted or received. Comparing a quoted amount directly with an unlabelled execution amount can mix those meanings. Token amounts also need their own mint's decimal scaling before any display in whole-token units.


The Router path trades engine breadth for transaction control

The Router path returns raw swap instructions through /build and uses Metis exclusively. This supports custom instructions, cross-program invocation (CPI), and transactions that combine the swap with other operations. Cross-program invocation means one Solana program calls another. The integration controls construction and can handle submission through its own remote procedure call (RPC) service, or use Jupiter's submission service with SOL tips.

Managed Meta-Aggregator transactions do not permit modification. JupiterZ also gives market makers last-look execution rights and requires controlled transaction handling. An integration that needs to alter the returned swap transaction must choose the Router path, accepting its different liquidity scope.

Fee treatment also differs between paths. Managed quotes report a Jupiter platform fee that varies by token pair; the Router path has no Jupiter swap platform fee. Integrator charges and network costs remain separate considerations. The choice follows the required transaction structure: custom composition uses Metis instructions, while an unchanged managed swap can retain competition from JupiterZ, Dflow, and OKX.

Still wondering about Jupag routing?

Does manual mode identify the selected swap engine?

Manual mode describes applied optional settings, not the engine that won the quote. In Swap API v2, the mode field distinguishes default ultra behavior from manual configuration. The separate router field identifies Metis, JupiterZ, Dflow, or OKX. A manual response does not by itself mean that only Metis was eligible.

Why does JupiterZ require a market maker signature?

A JupiterZ RFQ transaction needs authorization from both the trading wallet and the market maker. The wallet signs first, and the maker adds its signature during managed execution through /execute. Integrations must support partial signing so the maker can complete its part of that transaction.

What unit should the routing request use for its input amount?

The amount parameter uses the smallest unit of the input token. It does not accept an unscaled whole-token quantity as an equivalent value. The input mint's decimals determine the conversion, so an integration must apply that token's decimal precision before requesting the quote.

How does order error code 2 change between routers?

Order error code 2 means insufficient SOL for gas on Metis, Dflow, and OKX, but a missing associated token account on JupiterZ. This distinction applies to an order response that could quote pricing but returned an empty transaction string. The router value determines which meaning applies.

Which optional parameters leave all four swap engines eligible?

In the Swap API v2 routing matrix, receiver and the referralAccount/referralFee combination leave Metis, JupiterZ, Dflow, and OKX eligible. Other settings can still restrict the request. Referral parameters disable automatic Jupiter sponsorship; on JupiterZ, the taker then pays any required output token account rent. Engine eligibility alone does not establish execution readiness.

Will excluding JupiterZ also remove the onchain routers?

Excluding JupiterZ alone leaves Metis, Dflow, and OKX eligible in the Swap API v2 Meta-Aggregator. Additional restrictions, including a payer different from the taker, can narrow that set further. The exclusion removes RFQ participation without itself forcing the request onto the standalone Router path.

Is the platform fee identical to the total quoted fee rate?

The top-level feeBps field can exceed platformFee.feeBps when the managed swap includes additional charges, such as gasless cost recovery. The nested field identifies Jupiter's platform fee rate; the top-level field represents the total swap fee rate.

Do I need a taker address to request a price quote?

A taker address is unnecessary for a quote-only request. Without taker, the managed order response contains pricing but no assembled transaction to sign. Supplying the trading wallet's address enables transaction construction, subject to the route's build requirements.