Skip to main content

Get an indicative price for a transaction

GET 

/api/v1/trade/price

Get an indicative price for a transaction

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.

Responses

Indicative price for the transaction

Details

Schema

    price string

    Price of buyToken in sellToken and vice versa.

    grossPrice string

    Price with fees removed.

    estimatedPriceImpact string

    Estimated change in price due to price impact.

    value string

    Amount of ether (in wei) to be sent with the transaction.

    gasPrice string

    Gas price (in wei) for the transaction.

    gas string

    Estimated gas limit for the transaction.

    estimatedGas string

    Estimate of the actual gas used in the transaction.

    protocolFee string

    Maximum ether paid towards the protocol fee (in wei).

    minimumProtocolFee string

    Minimum ether paid towards the protocol fee (in wei).

    buyAmount string

    Amount of buyToken that would be bought in this swap.

    grossBuyAmount string

    BuyAmount with fees removed.

    sellAmount string

    Amount of sellToken that would be sold in this swap.

    grossSellAmount string

    SellAmount with fees removed.

    Details

    sources

    object[]

    Distribution of buyAmount or sellAmount between liquidity sources.

  • Array [

  • name string
    proportion string
  • ]

  • buyTokenAddress string

    ERC20 token address of the token you want to receive.

    sellTokenAddress string

    ERC20 token address of the token you want to sell.

    allowanceTarget string

    Target contract address for which the user needs to have an allowance.

    sellTokenToEthRate string

    Rate between ETH and sellToken.

    buyTokenToEthRate string

    Rate between ETH and buyToken.

    expectedSlippage string

    Expected slippage used in routing calculations for the quote.

    Details

    fees

    object

    Fees that would be charged, including 0x fee details.

    Details

    zeroExFee

    object

    feeType string
    feeToken string
    feeAmount string
    billingType string
Loading...

Was this page helpful?