Quoting Routes
Quoting calculates available swap routes without executing anything on-chain. Use quotes to show users their options before they confirm a transaction.Common request parameters
All quote methods accept these base fields:| Field | Type | Description |
|---|---|---|
srcTokenBlockchain | BlockchainName | Source blockchain (e.g. 'ETH', 'BSC', 'POLYGON') |
srcTokenAddress | string | Token address on the source chain. Use 0xEeee...EEeE for native tokens |
srcTokenAmount | string | Amount to swap in token units (not wei) |
dstTokenBlockchain | BlockchainName | Destination blockchain |
dstTokenAddress | string | Token address on the destination chain |
fromAddress | string | (optional) Sender wallet address. Required by some providers for accurate quotes |
receiver | string | (optional) Recipient address on the destination chain |
slippage | number | (optional) Max slippage in percent (e.g. 1 = 1%) |
integratorAddress | string | (optional) Overrides the SDK-level integrator address for this request |
preferredProvider | string | (optional) Force a specific provider |
enableChecks | boolean | (optional) Enable balance/gas checks. Default: true |
showFailedRoutes | boolean | (optional) Include failed routes in quoteAll response. Default: false |
quoteBest
Returns the single route with the highest expected output.Example
Response: QuoteResponseInterface
| Field | Type | Description |
|---|---|---|
id | string | Trade identifier — pass this to swap() |
providerType | string | Bridge or DEX used (e.g. 'across', 'uniswap-v3') |
swapType | 'cross-chain' | 'on-chain' | Type of the swap |
tokens.from | TokenInterface | Source token info + amount |
tokens.to | TokenInterface | Destination token info + expected amount |
estimate.destinationTokenAmount | string | Expected output in token units |
estimate.destinationTokenMinAmount | string | Minimum output after slippage |
estimate.durationInMinutes | number | Estimated completion time |
estimate.priceImpact | number | null | Price impact in percent |
fees.gasTokenFees | object | Gas fee breakdown |
fees.percentFees | object | Protocol and integrator fee breakdown |
routing | RoutingInterface[] | Step-by-step route path |
warnings | ErrorInterface[] | Non-fatal provider warnings |
useRubicContract | boolean | Whether the swap goes through Rubic proxy contracts |
quoteAll
Returns all available routes, sorted by expected output (best first).Example
Response: QuoteAllInterface
| Field | Type | Description |
|---|---|---|
quote | QuoteRequestInterface | Echo of the original request |
routes | QuoteResponseInterface[] | Successful routes, sorted best-first |
failed | FailedQuoteInterface[] | Failed routes (only if showFailedRoutes: true) |
quoteDepositTrades
Returns routes where the user sends funds directly to a deposit address — no on-chain transaction is required from the source wallet. Useful for CEXes, hardware wallets, or any scenario where the user can’t sign a transaction.The request is the same asquoteAllbutfromAddressis optional and the response only contains deposit-based providers (e.g. ChangeNOW, Exolix, SimpleSwap).
Example
Comparing providers
Next step
Once you have a quote and itsid, pass it to sdk.swap() to get transaction data.