Liquidity sources
Each source has anaggregatorId. It appears in quotes, you pass it to POST /swap, and you can exclude it from a quote.
Use the IDs exactly as the API returns them:
oneInch, for example, not 1inch. Which sources quote varies by chain and over time, so read aggregatorOrder in each quote instead of assuming a source is available. Cross-chain transfers use a separate set of providers, covered in Cross-chain mechanics.
How the winner is chosen
For a single-chain quote, Olympex requests a quote from each source it doesn’t exclude. Sources that fail or return nothing drop out. The rest are ranked byparams.orderBy:
The first source in the ranking becomes
aggregatorId, and the full ranking is returned as aggregatorOrder.
MAX_OUT_AMOUNT compares output amounts only; it doesn’t subtract gas. When gas is a large share of the trade, request includeGasInfo: true and weigh dataFeeTransaction.transactionFeeInUSD against the output before you show the quote. The gas-based orderings rely on each source’s own estimatedGas, and a source that gives no estimate reports "0" or omits estimatedGas, so treat those rankings with the same caution as the estimates. Gas and fees explains the gas fields.
orderBy, excludeMetaAggregatorId, includeGasInfo and gasMultiplier apply to single-chain quotes only.
Excluding sources
params.excludeMetaAggregatorId takes an array of IDs to leave out of the comparison:
/swap failure you want to route around on the next quote, and your own policy about which venues you use.
Reading the route
A single-chain quote describes the route the winning source found. This excerpt comes from a quote for 10 USDT to USDC on Polygon, with the fields that describe the route:Quote excerpt
The breakdown comes from the winning source in that source’s own shape, and the level of detail varies by source. In the excerpt, the first two routes report 90.2375 and 9.7625 (with the source’s floating-point noise), then four more routes report 100 for the later hops. Use
routes and market to show users how their trade is filled, not for accounting. The amounts that count are outAmount from the quote and minOutAmount from /swap.
Falling back with aggregatorOrder
aggregatorOrder lists the sources that returned a quote, best first, and starts with the winner. In the example above, oneInch won, and uniswapV3Hermes also quoted.
Fall back in either of these cases:
POST /swapfails with422 NO_ROUTEor500 SWAP_ERRORfor the winning source.POST /swapsucceeds, buteth_estimateGasof its calldata reverts. A200doesn’t guarantee that the calldata executes: a source can build calldata that reverts. When the allowance, the balance and the expiry are in order, the route itself can’t execute, and building again with the same source returns the same route.
- Retry
/swapwith the next ID inaggregatorOrder. - Request a fresh quote, optionally excluding the failed source, and build with the new
aggregatorId.
aggregatorOrder: request a new quote instead. Each source prices the trade separately. Read swap.outAmount and swap.minOutAmount from the fallback response and show them to the user before anyone signs: they are what the calldata commits to.
When no route is found
If no source can quote the pair and amount,POST /quotes returns 422 with NO_ROUTE, for single-chain and cross-chain quotes:
NO_ROUTE also covers every source failing or not answering in time, so it can be temporary: Olympex doesn’t tell the two cases apart. The detail text varies by mode and cause. Branch on error.code, and don’t parse message or details.
Retry with backoff, and sign each attempt again. If it persists, try a different amount or pair, and check that your exclusions haven’t removed every source that can fill the trade.
Quotes are not reserved
A quote reflects the sources’ prices at the moment you asked. Olympex doesn’t hold that price for you, so request/swap right after the quote and send the transaction right after /swap. Some routes include a market maker’s firm quote (an RFQ leg) whose price expires within seconds of the build. Send those at once, and if the transaction reverts because that quote expired, build the swap again. Slippage and price impact covers how your slippage setting protects the trade in between.
What this means for your integration
- Pass the quote’s
aggregatorIdto/swapunchanged, and keepaggregatorOrderfor fallbacks when/swapfails or its calldata doesn’t passeth_estimateGas. - Don’t reuse old quotes. Request a new one when the user changes the pair or amount, and before you build a transaction.
- Show the user
swap.outAmountandswap.minOutAmount, not the quote, as the final numbers. - Treat
routesandmarketas display data whose shape varies by source.
Related
Slippage and price impact
How much the price can move, and what your trade size costs.
Gas and fees
Gas estimates and integrator fees.
Get a quote
The
POST /quotes reference.Get a swap quote
The step-by-step guide.
