[OLD] Instadapp Docs
  • Introduction
  • DeFi Smart Account (DSA)
  • DSA SDK
    • Running Instadapp SDK
  • 💻Instadapp GUI
    • Integrated Protocols
      • Aave
      • Compound Finance
      • MakerDAO
    • Strategies
    • Multi-Protocol Refinancing
    • Authorities
    • Debt Collateral Ratio
  • 👩‍💻 DSA SDK
    • Casting Spells
    • Build a Connector
    • Connectors
      • Basic
      • Authority
      • Instapool
      • MakerDAO
      • Compound
      • Comp
      • Aave
      • dYdX
      • 1Inch
      • Uniswap
      • OasisDEX
      • Kyber
      • Curve sBTC
      • Curve sUSD
      • Curve yUSD
    • Resolvers
      • Accounts
      • Balances
      • Instapool
      • MakerDAO
      • Compound
      • Aave
      • dYdX
      • 1inch
      • Uniswap
      • OasisDex
      • Kyber
      • Curve sBTC
      • Curve sUSD
      • Curve yUSD
    • getId/setId
    • Example Use Cases
      • Long ETH
      • Short DAI
      • Debt Swap
      • Lending Bridge
      • Lending Swap
      • Debt Bridge
  • 👩‍🏫 Tutorials
    • Getting Started
    • Moving Assets into DSA
    • In-App Swaps
  • Additional Info
    • Contract Infomation
    • FAQs
    • Security Audits
    • Release History
  • 🌏Links
    • Homepage
    • DApp
    • Discord
    • Contact Us
Powered by GitBook
On this page
  1. 👩‍💻 DSA SDK
  2. Resolvers

1inch

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);

Parameter

Type

Description

buyToken

address

The buy token symbol.

sellToken

address

The sell token symbol.

sellAmt

number

The amount of tokens to sells.

slippage

number

The slippage in percent eg - 1 means 1%, 10 means 10%, etc

distribution

array

(Optional) If not defined, default will be used. The distribution of DEXs to swap accross

disableDexes

number

(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 Parameter

Type

Description

buyAmt

number/string

Expected buy token amount.

buyAmtRaw

number/string

Expected buy token amount in decimal form.

unitAmt

number/string

The 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.

distribution

array

The distribution of swap across differnt DEXs.

PreviousdYdXNextUniswap

Last updated 4 years ago