1inch

1inch Resolver

1inch Resolver to get buy and sell details. You can view details like source code, ABIs on Etherscan.


Get buy amount.

Get buy token details like amount and unit amount.

dsa.oneInch.getBuyAmount(buyToken, sellToken, sellAmt, slippage, distribution, disableDexes);
ParameterTypeDescription
buyTokenaddressThe buy token symbol.
sellTokenaddressThe sell token symbol.
sellAmtnumberThe amount of tokens to sells.
slippagenumberThe slippage in percent eg - 1 means 1%, 10 means 10%, etc
distributionarray(Optional) If not defined, default will be used. The distribution of DEXs to swap accross
disableDexesnumber(Optional) If not all DEXs will stay enabled. The number of DEXs to disable.

Returns: Object of sell token details.

{
  buyAmt: "2208.0499999999997",
  buyAmtRaw: "2208050000000000000000",
  unitAmt: "216388900000000000000",
  distribution: ["0", "0", ..]
}
Return ParameterTypeDescription
buyAmtnumber/stringExpected buy token amount.
buyAmtRawnumber/stringExpected buy token amount in decimal form.
unitAmtnumber/stringThe unit amount is the minimum amount of buy token expected per sell token. It is calculated with the help of slippage. The parameter is passed directly in the kyber connector.
distributionarrayThe distribution of swap across differnt DEXs.

If you still can't find something you're looking for or have any questions, ask them at our developers community on Telegram, Discord or simply send an Email.

Our team is excited about assisting you to build an application using Instadapp Developer Platform. Your questions and feedback help us make a better development environment for future developers.

Best way to stay connected with our progress.