# OasisDex

OasisDEX connector triggers the methods like buy and sell tokens You can view details like source code, ABIs on [Etherscan](https://etherscan.io/address/0x57118572267072fcaEe72b15aE18B07A8b0d6144#code).

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://instadapp-3.gitbook.io/instadapp-docs/dsa-sdk/resolvers/oasis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
