Links
Comment on page

Quote Response Detail

Quote response detail

Status (Result Type)

Using resultType field, you could decide if the quote response is valid or need to show a proper message to the user. Possible values for this field are OK , HIGH_IMPACT , INPUT_LIMIT_ISSUE and NO_ROUTE.
resultType
Reason
OK
Best route found. Everything is OK.
HIGH_IMPACT
If the best route has a high price impact, we recommend not proceeding with the next step (swap). The Rango API may give you an error in the next step to prevent potential losses.
INPUT_LIMIT_ISSUE
There is a limit issue for the input amount. You could suggest user increase/decrease the input amount based on amountRestrictionsfield.
NO_ROUTE
No routes found.

Limits (Amount Restrictions)

The amountRestriction field indicates the minimum and maximum possible input amount for this quote. EXCLUSIVE field means that min<input<max and INCLUSIVE means min<=input<=max.
sample quote, amountRestriction
1
{
2
// other fields ...,
3
"amountRestriction": {
4
"min": "40666469010361176",
5
"max": "67777448350601960000000",
6
"type": "INCLUSIVE"
7
},
8
}

Fee (Expense Types)

These are two possible types of fees (expenseType field in the fee array).
expenseType
Description
FROM_SOURCE_WALLET
The gas fee. This fee should be available in the user's wallet for the swap to succeed.
DECREASE_FROM_OUTPUT
Some hidden fees in swapper which will be reduced from the user's output amount automatically. This fee is already calculated in the estimated output.
And this is a sample fee object you get through the quote/swap endpoint. You could show the user feeUsd amount as the total fee he/she should pay for this route.
sample quote, fee
1
{
2
// other fields ...,
3
"feeUsd": 0.2527750142059618,
4
"fee": [{
5
"token": {
6
"blockchain": "BSC",
7
"symbol": "BNB",
8
"name": null,
9
"isPopular": true,
10
"chainId": "56",
11
"address": null,
12
"decimals": 18,
13
"image": "https://api.rango.exchange/tokens/ETH/BNB.png",
14
"blockchainImage": "https://api.rango.exchange/blockchains/bsc.svg",
15
"usdPrice": 243.71759113601925,
16
"supportedSwappers": [
17
"Wormhole",
18
"ParaSwap Bsc",
19
"OneInchBsc",
20
"cBridge v2.0"
21
]
22
},
23
"expenseType": "FROM_SOURCE_WALLET",
24
"amount": "1037163600000000",
25
"name": "Network Fee"
26
}
27
]