> For the complete documentation index, see [llms.txt](https://docs.yad.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yad.finance/~/changes/2RSiZ02fGs3gXznJHipO/api-documentation/endpoints-and-functions/get-v1-chainid-quote.md).

# GET /v1/{chainID}/quote

Returns the best exchange offer and input parameters for the transaction

## **Input Parameters**

| Name                      | Required | Description                                                                                                                                                                                                        |
| ------------------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **chainID**               |     +    | ID of the blockchain tokens must be exchanged on (supported networks - `v1/platforms`).                                                                                                                            |
| **fromTokenAddress**      |     +    | Smart contract address of the sale token.                                                                                                                                                                          |
| **toTokenAddress**        |     +    | Smart contract address of the purchase token.                                                                                                                                                                      |
| **takerAddress**          |     -    | The address which will fill the quote. When provided the gas will be estimated and returned.                                                                                                                       |
| **amount**                |     +    | The amount of sale tokens in decimals of the token (can be taken from the method `/tokens`).                                                                                                                       |
| **slippage**              |     +    | The amount of slippage allowed during the actual execution of the transaction (10 = 1% slippage). If the price changes by more than this percentage, the transaction will revert. Min = 1 (0.1%), max = 500 (50%). |
| **gasPrice**              |     -    | Gas price value for making a transaction in WEI (nAVAX for Avalanche) (1 GWEI = 1000000000 WEI), default value is the value high from `/gasprices`.                                                                |
| **feeRecipient**          |     -    | Wallet address for receiving fees. The commission is paid from the purchase token.                                                                                                                                 |
| **buyTokenPercentageFee** |     -    | Percentage of commission from the amount of purchase tokens, is taken in favor of feeRecipient. (10 = 1%, maximum value is 500).                                                                                   |

## **Response Options**

| Name                       | Data type | Description                                                                                                                                                                                   |
| -------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **amount\_out\_total**     | `str`     | The amount of purchase tokens in decimals of the token.                                                                                                                                       |
| **estimate\_gas\_total**   | `str`     | The estimated amount of gas that will be used during the transaction.                                                                                                                         |
| **gas\_price**             | `str`     | Gas price value for a transaction in WEI (nAVAX for Avalanche).                                                                                                                               |
| **fee\_recipient\_amount** | `str`     | The amount of purchase tokens in decimals of the token, which will be taken in favor of feeRecipient. The value will be 0 if feeRecipient and buyTokenPercentageFee fields are not specified. |
| **token\_in**              | `str`     | Smart contract address of the sale token.                                                                                                                                                     |
| **token\_out**             | `str`     | Smart contract address of the purchase token.                                                                                                                                                 |
| **routes**                 | `array`   | An array of DEXs the transaction will be carried out through.                                                                                                                                 |
| **protocol\_name**         | `str`     | DEX name the transaction will be carried out through.                                                                                                                                         |
| **percent**                | `int`     | The percent of amount will be swapped on the current DEX.                                                                                                                                     |
| **calldata**               | `str`     | One of the input parameters for processing a transaction for tokens exchange.                                                                                                                 |
| **to**                     | `str`     | Smart contract address where input parameters should be sent to.                                                                                                                              |

## **Request Example**

```
https://api.yad.finance/v1/1/quote?fromTokenAddress=0xdac17f958d2ee523a2206206994597c13d831ec7&toTokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f&amount=1500000000&slippage=1&gasPrice=16000000000&feeRecipient=0xdac17f958d2ee523a2206206994597c13d831ec7&buyTokenPercentageFee=1
```

## **Response Example**

```
{
  "amount_out_total": "1498829767947395025220",
  "estimate_gas_total": "265000",
  "token_in": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  "token_out": "0x6b175474e89094c44da98b954eedeac495271d0f",
  "gas_price": "16000000000",
  "fee_recipient_amount": "1497329440850006780",
  "routes": [
    {
      "protocol_name": "DODO_V2",
      "percent": 100,
      "pools": null
    }
  ],
  "calldata": "0x415565b0000000000000000000000000dac17f958d2ee523a2206206994597c13d.....00000d8b5e9d2b6359a3071e41296359A307",
  "to": "0x1AAAd07998466cD3Eb8140827DDdb37570BE1e63"
}
```
