> For the complete documentation index, see [llms.txt](https://aggreg8finance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aggreg8finance.gitbook.io/docs/api-parameters.md).

# API PARAMETERS

AGGREGATE ALOGORITHM PARAMETERS

#### Description of query parameters

| **Parameter name**   | **Type** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| -------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fromTokenAddress *` | string   | <p>contract address of a token to sell<br>e.g.: <code>0x6b175474e89094c44da98b954eedeac495271d0f</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `toTokenAddress *`   | string   | <p>contract address of a token to buy<br>e.g.: <code>0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `amount *`           | integer  | <p>amount of a token to sell, set in minimal divisible units e.g.:<br><code>1.00 DAI</code> set as <code>1000000000000000000</code><br><code>51.03 USDC</code> set as <code>51030000</code></p>                                                                                                                                                                                                                                                                                                                                                                      |
| `fromAddress *`      | string   | <p>address of a seller, make sure that this address has approved to spend fromTokenAddress in needed amount<br>e.g.: <code>0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5</code></p>                                                                                                                                                                                                                                                                                                                                                                                     |
| `slippage *`         | number   | limit of price slippage you are willing to accept in percentage, may be set with decimals. \&slippage=0.5 means 0.5% slippage is acceptable. Low values increase chances that transaction will fail, high values increase chances of front running. Set values in the range from 0 to 50                                                                                                                                                                                                                                                                             |
| `protocols`          | string   | <p>specify liquidity protocols. If not set, all liquidity protocols will be used; you can disable any protocol by listing all protocols except those you don't need<br>e.g.: <code>\&protocols=WETH,CURVE,BALANCER,...,ZRX</code><br><code>default: all protocols can be used</code></p>                                                                                                                                                                                                                                                                             |
| `destReceiver`       | string   | <p>recipient address of a purchased token<br>if not set, fromAddress will receive a purchased token</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `referrerAddress`    | string   | referrer's address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `fee`                | number   | <p>this percentage of fromTokenAddress token amount will be sent to referrerAddress, the rest will be used as input for a swap<br><code>min: 0;</code> <code>max: 3;</code> <code>default: 0</code><br>example to set a fee to 1.5%: <code>\&fee=1.5</code></p>                                                                                                                                                                                                                                                                                                      |
| `gasPrice`           | string   | <p>Aggreg8 takes in account gas expenses to determine exchange route. It is important to use the same gas price on the quote and swap methods.<br>Gas price set in wei: <code>12.5 GWEI</code> set as <code>12500000000</code><br><code>default: "fast" from network</code></p>                                                                                                                                                                                                                                                                                      |
| `permit`             | string   | <https://github.com/bnb-chain/BEPs>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `burnChi`            | boolean  | <p>If true, CHI will be burned from fromAddress to compensate gas. Check CHI balance and allowance before turning that on. CHI should be approved for the spender address<br><code>default: false</code></p>                                                                                                                                                                                                                                                                                                                                                         |
| `complexityLevel`    | string   | <p>maximum number of token-connectors to be used in a transaction. The more is used — the longer route estimation will take, the more complex route might be as a result. If not set, two token-connectors may be used<br><code>min: 0;</code> <code>max: 3;</code> <code>default: 2</code></p>                                                                                                                                                                                                                                                                      |
| `connectorTokens`    | string   | <p>token-connectors can be specified via this parameter. The more is set — the longer route estimation will take. If not set, default token-connectors will be used. If a token you want to exchange doesn't have a pool with one of the default token-connectors this parameter will help find the route; should be the same for a quote and swap <code>max: 5;</code><br>e.g.: <code>\&connectorTokens=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE, 0x6b175474e89094c44da98b954eedeac495271d0f</code><br><code>default: list of default token-connectors</code></p> |
| `allowPartialFill`   | boolean  | <p>if true, the algorithm can cancel part of the route, if the rate has become less attractive. Unswapped tokens will return to the fromAddress<br><code>default: true</code></p>                                                                                                                                                                                                                                                                                                                                                                                    |
| `disableEstimate`    | boolean  | <p>if true, disable most of the checks<br><code>default: false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `gasLimit`           | integer  | <p>maximum amount of gas for a swap;<br>should be the same for a quote and swap<br><code>default: 11500000;</code> <code>max: 11500000</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `mainRouteParts`     | integer  | <p>limit maximum number of main route parts;<br>should be the same for a quote and swap<br><code>default: 20;</code> <code>max: 50</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `parts`              | integer  | <p>limit maximum number of parts each main route parts can be split into; should be the same for a quote and swap<br><code>default: 20;</code> <code>max: 100</code></p>                                                                                                                                                                                                                                                                                                                                                                                             |

#### Description of response parameters[#](https://docs.1inch.io/docs/aggregation-protocol/api/swap-params/#description-of-response-parameters) <a href="#description-of-response-parameters" id="description-of-response-parameters"></a>

| **Parameter name** | **Type** | **Description**                                              |
| ------------------ | -------- | ------------------------------------------------------------ |
| `fromToken`        | string   | parameters of a token to sell                                |
| `toToken`          | string   | parameters of a token to buy                                 |
| `fromTokenAmount`  | string   | input amount of `fromToken` in minimal divisible units       |
| `toTokenAmount`    | string   | result amount of `toToken` in minimal divisible units        |
| `protocols`        | string   | route of the trade                                           |
| `from`             | string   | transactions will be sent from this address                  |
| `to`               | string   | transactions will be sent to our contract address            |
| `data`             | string   | bytes of call data                                           |
| `value`            | string   | amount of BNB (in wei) will be sent to the contract address  |
| `gasPrice`         | string   | gas price in wei                                             |
| `gas`              | string   | estimated amount of the gas limit, increase this value by 25 |
