1inch

DEX Aggregator

1inch connector triggers methods like sell. You can view details like source code, ABIs on Etherscan.

  • Use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee to indicate ETH.
  • use -1 or dsa.maxValue for the maximum amount in function.
  • If not sure about the arguments getId and setId, pass 0.

Sell via On-Chain DEXs

Swap tokens from exchanges like kyber, uniswap etc. Calculation is done on-chain, with high gas cost.

spells.add({
  connector: "oneInch",
  method: "sell",
  args: [buyAddr, sellAddr, sellAmt, unitAmt, getId, setId]
});
ParameterTypeDescription
buyAddraddressThe address of the token to buy.
sellAddraddressThe address of the token to sell.
sellAmtnumberThe amount of the token to sell.
unitAmtnumberThe amount of buyAmt/sellAmt with slippage.
getIdnumberID fetches the amount of token to deposit.
setIdnumberID stores the amount of token deposited.

Sell via DEXs with Off-Chain Calculation

Swap tokens from exchanges like kyber, uniswap etc, but with the calculation done off-chain, thus, with a lower gas cost.

spells.add({
  connector: "oneInch",
  method: "sellTwo",
  args: [buyAddr, sellAddr, sellAmt, unitAmt, distribution, disableDexes, getId, setId]
});
ParameterTypeDescription
buyAddraddressThe address of the token to buy.
sellAddraddressThe address of the token to sell.
sellAmtnumberThe amount of the token to sell.
unitAmtnumberThe amount of buyAmt/sellAmt with slippage.
distributionarrayThe distribution of swap across different DEXs.
disableDexesnumberTo disable a dex. (To disable none: 0)
getIdnumberID fetches the amount of token to deposit.
setIdnumberID stores the amount of token deposited.

Sell via On-Chain and Off-Chain Exchanges

Swap tokens from exchanges like kyber, 0x etc, with calculation done off-chain.

spells.add({
  connector: "oneInch",
  method: "sellThree",
  args: [buyAddr, sellAddr, sellAmt, unitAmt, callData, getId, setId]
});
ParameterTypeDescription
buyAddraddressThe address of the token to buy.
sellAddraddressThe address of the token to sell.
sellAmtnumberThe amount of the token to sell.
unitAmtnumberThe amount of buyAmt/sellAmt with slippage.
callDatanumberThis is the data from the 1inch API.
getIdnumberID fetches the amount of token to deposit.
setIdnumberID stores the amount of token deposited.

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.