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.

Last updated