Request Quote

Get routes between token A and token B

Quote Best

Using the quote method, you can get a preview of the best route for this cross-chain swap. It goes through all the possible DEXs, bridges and aggregators to find the best possible single-step route based on user experience, fee amount, and swap output. You can check available request params here.

Here is an example of quoting swap 1.05 ETH in Ethereum Blockchain for Matic in Polygon Blockchain

const response = await axios.post('https://api-v2.rubic.exchange/api/routes/quoteBest', {
  params: {
    "dstTokenAddress": "0x0000000000000000000000000000000000000000",
    "dstTokenBlockchain": "POLYGON",
    "referrer": "rubic.exchange",
    "srcTokenAddress": "0x0000000000000000000000000000000000000000",
    "srcTokenAmount": "1.05",
    "srcTokenBlockchain": "ETH"
  }
});
Swagger Link

Quote All

Using the quote method, you can get a preview of all possible routes for this cross-chain swap. It goes through all the possible DEXs, bridges and aggregators to find and provide all single-step routes based on user experience, fee amount, and swap output. You can check available request params here.

Here is an example of quoting swap 1.05 ETH in Ethereum Blockchain for Matic in Polygon Blockchain

const response = await axios.post('https://api-v2.rubic.exchange/api/routes/quoteAll', {
  params: {
    "dstTokenAddress": "0x0000000000000000000000000000000000000000",
    "dstTokenBlockchain": "POLYGON",
    "referrer": "rubic.exchange",
    "srcTokenAddress": "0x0000000000000000000000000000000000000000",
    "srcTokenAmount": "1.05",
    "srcTokenBlockchain": "ETH"
  }
});
Swagger link

Quote request params

Required params

FieldTypeDescriptionExample

srcTokenAddress*

string

Source token address

0x0000000000000000000000000000000000000000

srcTokenBlockchain*

string

Source token blockchain

ETH

srcTokenAmount*

string

Source token amount with decimals

1.05

dstTokenAddress*

string

Destination token address

0x0000000000000000000000000000000000000000

dstTokenBlockchain*

string

Destination token blockchain

Polygon

referrer*

string

Referrer address

rubic.exchange

Optional fields

FieldTypeDescriptionExample

nativeBlacklist

string[]

Native providers to exclude from calculation

["xy", "symbiosis"]

showFailedRoutes

boolean

Show failed routes in response or not

false

integratorAddress

string

Integrator address to set fees

Get the address from our BD team

slippage

number minimum: 0.01 maximum: 0.5

Slippage tolerance in percents for trade, 0.01 equals 1%

0.02

receiver

string

Wallet address to send tokens to on the destination blockchain

0x0000000000000000000000000000000000000000

preferredProvider

string

Preferred provider for calculation

lifi

foreignBlacklist

{

lifi?: string[];

rango?: string[];

}

Foreign providers to exclude from calculation

{ lifi: ["stargate"] }

timeout

number minimum: 5 maximum: 60

Calculation timeout in seconds

32

enableTestnets

boolean

Include testnet in calculations

false

fromAddress

string

Wallet address to send funds from

0x0000000000000000000000000000000000000000

Quote response params

FieldTypeDescriptionExample

id

string

Trade identifier

60e513d5-8a2d-4e0d-b513-6236d86bc7da

quote

Quote params that you send

swapType

'cross-chain' | 'on-chain'

Type of swap

cross-chain

providerType

Inner provider which we use to swap

Rango

fees

Different fees used for swap

routing

The path tokens take during the swap process

transaction

Transaction config to perform approve

{

approvalAddress: string }

warnings

Specific info about quote params provider

[ { code: 301, reason: amountTooLow, data: { minAmount: 0.1 eth } ]

Last updated