# 1inch

1inch Resolver to get buy and sell details. You can view details like source code, ABIs on [Etherscan](https://etherscan.io/address/0x16F0a50305c6aCf1A44A3DAa225531e731f39A9F#code).

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


---

# 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/1inch.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.
