[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
  • Buy
  • Sell
  1. 👩‍💻 DSA SDK
  2. Resolvers

OasisDex

OasisDEX connector triggers the methods like buy and sell tokens You can view details like source code, ABIs on Etherscan.

  • Use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee to indicate ETH.

  • Slippage amount is in percentage. For example, use 2 * 10 ** 16 to denote 2%.

  • If not sure about the arguments getId and setId, pass 0.

Buy

Buy tokens

spells.add({
  connector: "oasis",
  method: "buy",
  args: [buy_token, sell_token, buy_amt, unit_amt, getId, setId]
});

Parameter

Type

Description

buy_token

address

The token address to buy.

sell_token

address

The token address to sell.

buy_amt

number

The amount of tokens to buy.

unit_amt

number

sell token amt per buy token

getId

number

ID fetches the amount of token to deposit.

setId

number

ID stores the amount of token deposited.

Sell

Sell tokens

spells.add({
  connector: "oasis",
  method: "sell",
  args: [buy_token, sell_token, sell_amt, unit_amt, getId, setId]
});

Parameter

Type

Description

buy_token

address

The token address to buy.

sell_token

address

The token address to sell.

sell_amt

number

The amount of tokens to sell.

unit_amt

number

buy token amt per sell token

getId

number

ID fetches the amount of token to deposit.

setId

number

ID stores the amount of token deposited.

PreviousUniswapNextKyber

Last updated 4 years ago