Skip to main content

Get a quote for buying or selling any ERC20 token

GET 

/api/v1/trade/quote

Get a quote for buying or selling any ERC20 token

Request

Details

Query Parameters

    apiKey stringrequired

    Your Public API key.

    sellToken stringrequired

    The ERC20 token address of the token you want to sell.

    buyToken stringrequired

    The ERC20 token address of the token you want to receive.

    sellAmount string

    The amount of sellToken (in sellToken base units) you want to send.

    buyAmount string

    The amount of buyToken (in buyToken base units) you want to receive.

    slippagePercentage string

    The maximum acceptable slippage percentage.

    gasPrice string

    The target gas price for the swap transaction.

    takerAddress string

    The address which will fill the quote.

    excludedSources string

    Liquidity sources to exclude from the quote.

    includedSources string

    Liquidity sources to include in the quote.

    skipValidation boolean

    Skip validation of the quote.

    feeRecipient string

    The address that should receive affiliate fees.

    buyTokenPercentageFee string

    The percentage of the buyAmount attributed as affiliate fees.

    enableSlippageProtection boolean

    Enable slippage protection.

    priceImpactProtectionPercentage string

    Allowed price impact percentage.

    feeRecipientTradeSurplus string

    The recipient address of any trade surplus fees.

    shouldSellEntireBalance boolean

    Sell the entirety of the caller's takerToken balance.

Responses

Successful response with the quote details

Details

Schema

    price string
    guaranteedPrice string
    to string
    data string
    value string
    gasPrice string
    gas string
    estimatedGas string
    protocolFee string
    minimumProtocolFee string
    buyAmount string
    sellAmount string
    Details

    sources

    object[]

  • Array [

  • name string
    proportion string
  • ]

  • buyTokenAddress string
    sellTokenAddress string
    allowanceTarget string
    Details

    fees

    object

    Details

    zeroExFee

    object

    feeType string
    feeToken string
    feeAmount string
    billingType string
    grossPrice string
    grossBuyAmount string
    grossSellAmount string
    sellTokenToEthRate string
    buyTokenToEthRate string
    expectedSlippage string
Loading...

Was this page helpful?