#
POST /quote
/quote
requests should be called via the Quicknode endpoint you used to configure on each chain. Parameters are passed in via JSON.
https://YOUR_QUICKNODE_ENDPOINT_HERE.com/addon/688/quote
#
Usage
#
Required Parameters
#
Optional Parameters
To request and receive responses from 0x and 1inch, you must pass in zeroExApiKey
and/or oneInchApiKey
parameters
#
Premium (optional) Parameters
These parameters are a premium feature of the swap-api. Purchase a premium plan in order to set your own fee
#
Example:
Request
curl -X POST "https://YOUR_QUICKNODE_ENDPOINT_HERE.com/addon/688/quote"
-H "Content-Type: application/json"
-d '{
"tokenIn": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amountIn": "1000000000000000000",
"slippage": 1,
"chainId": 1,
"recipient": "0x92977D2552f455Bb9A3457AEbfCb78f1256Dd2e5",
"includeProtocols": "uniswap-v2,sushiswap",
"excludeProtocols": "uniswap-v3",
"fromTokenDecimals": 18,
"toTokenDecimals": 6,
}'
Response
{
"best": {
"aggregator": "OpenOcean",
"tokenIn": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amountIn": "1000000000000000000",
"amountOut": "3378798390",
"gas": "350520",
"amountOutMin": "3345010406"
},
"OpenOcean": {
"aggregator": "OpenOcean",
"tokenIn": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amountIn": "1000000000000000000",
"amountOut": "3378798390",
"gas": "350520",
"amountOutMin": "3345010406"
},
"Paraswap": {
"aggregator": "Paraswap",
"tokenIn": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amountIn": "1000000000000000000",
"amountOut": "3363203046",
"gas": "111435",
"amountOutMin": "3329571015"
},
"Odos": {
"aggregator": "Odos",
"tokenIn": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amountIn": "1000000000000000000",
"amountOut": "3363203046",
"gas": "229928",
"amountOutMin": "3329571015"
},
"Kyber": {
"aggregator": "Kyber",
"tokenIn": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amountIn": "1000000000000000000",
"amountOut": "3360473789",
"gas": "185000",
"amountOutMin": "3326869051"
}
}
Calling the /quote
endpoint with your desired parameters automatically standardizes and passes your parameters to several DEX aggregators and returns a response based on values from their native API. The body.best
collection populates based on which aggregator provides the most favorable value on the trade. Additionally body.best.aggregator
can then be used in the /swap endpoint to generate calldata
Additionally, you can filter out requests from specific aggregators via the excludeAggregator
parameter, or specifically only include aggregators via includeAggregators