GET /trade/v1/{chainId}/quote/single

Find all available quotes for single-chain trade via Unizen DEX Aggregator

By passing in the params, you will receive all available quotes for the trade from our supported DEXes

get
Path parameters
chainIdnumber · enumRequired

Chain id of the network

Example: 56Possible values:
Query parameters
fromTokenAddressstringRequired

The address of the token being traded. If native, use address zero.

Example: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c
toTokenAddressstringRequired

The address of the token to receive in exchange. If native, use address zero.

Example: 0x55d398326f99059fF775485246999027B3197955
amountstringRequired

Amount of tokens being traded

Example: 1000000000000000000
senderstringOptional

The address of the sender, if you want to estimate gas

Example: 0x54c47034887C582Fc1Af4a9a3b68180a8a9eF2d2
slippagenumberOptional

The maximum slippage allowed for the quote, in decimal form. Defaults to 0.005, which means 0.5% slippage.

Example: 0.005
deadlinenumberOptional

The timestamp of the transaction deadline.

Example: 1684459981
excludedDexesstringOptional

List of dexes excluded by chain

Example: {"1":["0x0000000000000"]}
priceImpactProtectionPercentagenumberOptional

The percentage of price impact protection, from 0 to 1

Example: 0.5
feePercentagenumberOptional

The fee percentage, from 0 to 1, with 2 decimals

slippageProtectionPercentagenumberOptional

The percentage of slippage protection, from 0 to 1, default 0.5

Example: 0.5
disableEstimatebooleanOptional

Disable estimate gas, by default, is set to true. If you want to obtain estimated gas for the quote in this API, set disableEstimate to false. NOTE: The estimated gas value provided here may not be accurate and should only be used for displaying predicted gas on the UI. For sending transactions, please use the estimateGas function in the /swap API.

isSplitbooleanOptional

Whether split trade is enabled. Default is true.

isExactOutbooleanOptional

Whether it is an exact out trade.

Responses
200
The best quote for the given trade parameters.
application/json
get
GET /trade/v1/{chainId}/quote/single?fromTokenAddress=text&toTokenAddress=text&amount=text HTTP/1.1
Host: 
Accept: */*
200

The best quote for the given trade parameters.

[
  {
    "fromTokenAmount": "1000000000000000000",
    "toTokenAmount": "275769482468993100000",
    "deltaAmount": "274390635056648134500",
    "tokenFrom": {
      "name": "ZCX",
      "symbol": "ZCX",
      "decimals": 18,
      "contractAddress": "0xc52c326331e9ce41f04484d3b5e5648158028804",
      "priceInUsd": 0.1,
      "chainId": 1,
      "buyTax": 0,
      "sellTax": 0
    },
    "tokenTo": {
      "name": "ZCX",
      "symbol": "ZCX",
      "decimals": 18,
      "contractAddress": "0xc52c326331e9ce41f04484d3b5e5648158028804",
      "priceInUsd": 0.1,
      "chainId": 1,
      "buyTax": 0,
      "sellTax": 0
    },
    "tradeType": 0,
    "protocol": [
      {
        "name": "0x",
        "logo": "https://s2.coinmarketcap.com/static/img/exchanges/64x64/1107.png",
        "route": [
          "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
          "0x55d398326f99059ff775485246999027b3197955"
        ],
        "percentage": 100
      }
    ],
    "transactionData": {
      "info": {
        "amountIn": "26031659637168024367",
        "amountOutMin": "26031659637168024367",
        "amountInMax": "26083722956442360416",
        "amountOut": "26083722956442360416",
        "actualQuote": "26083722956442360416",
        "srcToken": "text",
        "dstToken": "text",
        "uuid": "text",
        "apiId": "text",
        "userPSFee": 0,
        "deadline": 1684251,
        "tradeType": 0,
        "slippage": 0.1,
        "feePercent": 0,
        "sharePercent": 0,
        "tokenHasTaxes": false,
        "path": false,
        "v3Path": false
      },
      "amountInfo": {
        "amount": "26031659637168024367",
        "actualQuote": "26031659637168024367"
      },
      "call": [
        "text"
      ]
    },
    "nativeValue": "0",
    "gasPrice": "56442235035",
    "estimateGas": "11231133211313",
    "estimateGasError": "Execution reverted"
  }
]

Last updated

Was this helpful?