# Endpoint list

## A list of tokens and blockchains for bridging

<mark style="color:blue;">`GET`</mark> `v1/tokens/allForSwapAndBridge`

Provides a list of supported blockchains as well as a list of tokens for a destination network.\
\
**Request sample:**\
`https://api.yetanotherdefi.com/v1/tokens/allForSwapAndBridge`

{% tabs %}
{% tab title="200: OK OK" %}
{% tabs %}
{% tab title="Example" %}

```json
{
  "1": {
    "10": [
      {
        "chainId": 10,
        "address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        "name": "Ether",
        "symbol": "ETH",
        "decimals": 18,
        "logoURI": "",
        "is_active": false,
        "is_rfq_mode": false
      },
      {
        "chainId": 10,
        "address": "0x50c5725949a6f0c72e6c4a641f24049a917db0cb",
        "name": "Lyra Token",
        "symbol": "LYRA",
        "decimals": 18,
        "logoURI": "https://cl.yad.finance/static-files/1i/10/0x50c5725949a6f0c72e6c4a641f24049a917db0cb/48x48.png",
        "is_active": false,
        "is_rfq_mode": false
      }
    ]
  }
}
```

{% endtab %}

{% tab title="Schema" %}

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

<table><thead><tr><th width="189">Name</th><th width="156.66666666666666">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>{fromChainID}</strong></td><td><code>map (dictionary)</code></td><td>ChainID of “departure” networks.</td></tr><tr><td><strong>{toChainID}</strong></td><td><code>array</code></td><td>An array of supported tokens for "destination" network.</td></tr><tr><td><strong>chainId</strong></td><td><code>int</code></td><td>The blockchain network ID.</td></tr><tr><td><strong>address</strong></td><td><code>str</code></td><td>The token smart contract address.</td></tr><tr><td><strong>name</strong></td><td><code>str</code></td><td>Full name of the token.</td></tr><tr><td><strong>symbol</strong></td><td><code>str</code></td><td>Abbreviated name of the token.</td></tr><tr><td><strong>decimals</strong></td><td><code>int</code></td><td>The number of decimals used to get its user representation. For example, if decimals equals 2, a balance of 505 tokens should be displayed to a user as 5,05 (505 / 10 ** 2).</td></tr><tr><td><strong>logoURI</strong></td><td><code>str</code></td><td>A link to the token logo.</td></tr><tr><td><strong>is_active</strong></td><td><code>boolean</code></td><td>FALSE = the token is rarely used in exchanges on DEXs.</td></tr><tr><td><strong>is_rfq_mode</strong></td><td><code>boolean</code></td><td>TRUE = the token is supported by RFQ providers.</td></tr></tbody></table>

## Get gas prices

<mark style="color:blue;">`GET`</mark> `v1/{chainID}/gasprices`

Provides calculated gas price values in GWEI (nAVAX for Avalanche).

**Request sample:**\
`https://api.yad.finance/v1/1/gasprices`

#### Path Parameters

| Name                                      | Type    | Description                                             |
| ----------------------------------------- | ------- | ------------------------------------------------------- |
| chainId<mark style="color:red;">\*</mark> | Integer | The blockchain ID for which the gas price is requested. |

{% tabs %}
{% tab title="200: OK OK" %}
{% tabs %}
{% tab title="Example" %}

```json
{
  "baseFee": "13.757",
  "low": "14.757",
  "lowInfo": {
    "price": "14.757",
    "maxPriorityFeePerGas": "0.5",
    "maxFeePerGas": "14.257"
  },
  "medium": "16.757",
  "mediumInfo": {
    "price": "16.757",
    "maxPriorityFeePerGas": "0.55",
    "maxFeePerGas": "15.683"
  },
  "high": "18.757",
  "highInfo": {
    "price": "18.757",
    "maxPriorityFeePerGas": "0.65",
    "maxFeePerGas": "18.535"
  }
}
```

{% endtab %}

{% tab title="Schema" %}

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="400: Bad Request Bad Request" %}

{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error" %}

{% endtab %}
{% endtabs %}

<table><thead><tr><th>Name</th><th width="113.66666666666666">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>baseFee</strong></td><td><code>str</code></td><td>Base fee for the next block in blockchain.</td></tr><tr><td><strong>low</strong></td><td><code>str</code></td><td>The gas price at which the transaction is most likely to be accepted not earlier than after block 5. There is a risk of a long transaction confirmation.</td></tr><tr><td><strong>medium</strong></td><td><code>str</code></td><td>The gas price at which the transaction is most likely to be accepted in the next 2-3 blocks.</td></tr><tr><td><strong>high</strong></td><td><code>str</code></td><td>The gas price at which the transaction is most likely to be accepted in the next block.</td></tr><tr><td><strong>lowInfo (mediumInfo / highInfo)</strong></td><td><code>map</code></td><td>Detailed gas price info for EIP-1559.</td></tr><tr><td><strong>price</strong></td><td><code>str</code></td><td>Gas price (for legacy transactions, not EIP-1559).</td></tr><tr><td><strong>maxPriorityFeePerGas</strong></td><td><code>str</code></td><td>Max Priority Fee Per Gas (tips in EIP-1559).</td></tr><tr><td><strong>maxFeePerGas</strong></td><td><code>str</code></td><td>Max Fee Per Gas (for EIP-1559).</td></tr></tbody></table>

## Get price for pair

<mark style="color:blue;">`GET`</mark> `v1/price`

Returns the best route and exchange offer for pair, no calldata for transaction. Works faster than `/quote`.\
\
**Request sample:**\
`https://api.yetanotherdefi.com/v1/price?fromChainID=1&toChainID=137&fromTokenAddress=0xdac17f958d2ee523a2206206994597c13d831ec7&toTokenAddress=0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063&amount=150&slippage=10&feeRecipient=0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503&sellTokenPercentageFee=10&rfqOnly=false`<br>

#### Query Parameters

| Name                                               | Type    | Description                                                                                                                                                                                                                                                 |
| -------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| fromTokenAddress<mark style="color:red;">\*</mark> | String  | Smart contract address of the sale token.                                                                                                                                                                                                                   |
| toTokenAddress<mark style="color:red;">\*</mark>   | String  | Smart contract address of the purchase token.                                                                                                                                                                                                               |
| amount<mark style="color:red;">\*</mark>           | Integer | The amount of sale tokens in decimals of the token (can be taken from the method `/tokens`).                                                                                                                                                                |
| slippage<mark style="color:red;">\*</mark>         | Number  | <p>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%).<br><br><em>Default value</em> : 1</p> |
| gasPrice                                           | String  | 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                                       | String  | Wallet address for receiving fees. The commission is paid from the purchase token.                                                                                                                                                                          |
| sellTokenPercentageFee                             | Integer | Percentage of commission from the amount of sale tokens, is taken in favor of feeRecipient. (10 = 1%, maximum value is 500).                                                                                                                                |
| rfqOnly                                            | Boolean | <p>If TRUE: use only RFQ providers for routing.</p><p><br><em>Default value</em> : false</p>                                                                                                                                                                |
| excludeAggregator                                  | String  | Exclude some aggregators from routing (add several parameters for multiple exclude).                                                                                                                                                                        |
| includeAggregator                                  | String  | Include some aggregators from routing (add several parameters for multiple include). This parameter cannot be combined with excludedAggregators.                                                                                                            |
| fromChainID<mark style="color:red;">\*</mark>      | Integer | Source/sell blockchain ID                                                                                                                                                                                                                                   |
| toChainID<mark style="color:red;">\*</mark>        | Intger  | Destination/buy blockchain ID                                                                                                                                                                                                                               |
| onchainExcludeAggregator                           | String  | Exclude some aggregators from on-chain routing (add several parameters for multiple exclude).                                                                                                                                                               |
| onchainIncludeAggregator                           | String  | Include some aggregators from on-chain routing (add several parameters for multiple include). This parameter cannot be combined with onchainExcludeAggregators.                                                                                             |

{% tabs %}
{% tab title="200: OK OK" %}
{% tabs %}
{% tab title="Example" %}

```json
{
  "amount_out_total": "150513308498454",
  "estimate_gas_total": "500000",
  "token_in": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
  "token_out": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
  "gas_price": "17877704887",
  "bridge_fee": "<nil>",
  "fees": null,
  "routes": [
    {
      "type": "dex",
      "protocol_name": "native_polygon",
      "amount_in": "150",
      "amount_out": "150",
      "percent": 100
    }
  ]
}
```

{% endtab %}

{% tab title="Schema" %}

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="204: No Content No Content" %}

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="227">Name</th><th width="110.66666666666666">Data type</th><th>Description</th></tr></thead><tbody><tr><td><strong>amount_out_total</strong></td><td><code>str</code></td><td>The amount of purchase tokens in decimals of the token.</td></tr><tr><td><strong>estimate_gas_total</strong></td><td><code>str</code></td><td>The estimated amount of gas that will be used during the transaction.</td></tr><tr><td><strong>token_in</strong></td><td><code>str</code></td><td>Smart contract address of the sale token.</td></tr><tr><td><strong>token_out</strong></td><td><code>str</code></td><td>Smart contract address of the purchase token.</td></tr><tr><td><strong>gas_price</strong></td><td><code>str</code></td><td>Gas price value for a transaction in WEI (nAVAX for Avalanche).</td></tr><tr><td><strong>bridge_fee</strong></td><td><code>str</code></td><td>Bridge protocol fee.</td></tr><tr><td><strong>fees</strong></td><td><code>array</code></td><td>Partner's fee.</td></tr><tr><td><strong>amount</strong></td><td><code>str</code></td><td>The amount of sell tokens in decimals of the token, which will be taken in favor of feeRecipient. The value will be 0 if feeRecipient and sellTokenPercentageFee fields are not specified.</td></tr><tr><td><strong>recipient</strong></td><td><code>str</code></td><td>Wallet address for receiving fees. The commission is paid from the purchase token.</td></tr><tr><td><strong>token</strong></td><td><code>str</code></td><td>Address of fee token.</td></tr><tr><td><strong>routes</strong></td><td><code>array</code></td><td>An array of DEXs the transaction will be carried out through.</td></tr><tr><td><strong>type</strong></td><td><code>str</code></td><td>Liquidity source type.</td></tr><tr><td><strong>protocol_name</strong></td><td><code>str</code></td><td>DEX name the transaction will be carried out through.</td></tr><tr><td><strong>percent</strong></td><td><code>int</code></td><td>The percent of amount will be swapped on the current DEX.</td></tr></tbody></table>

## Transaction allowance

<mark style="color:blue;">`GET`</mark> `v1/{chainID}/transaction/allowance`

Checks how many of the user’s tokens the exchange smart contract has access to.

**Request sample:**\
`https://api.yad.finance/v1/1/transaction/allowance?tokenAddress=0xdAC17F958D2ee523a2206206994597C13D831ec7&walletAddress=0x58f58219e2d2598588c1b457bb6da65c34d99310`

#### Path Parameters

| Name                                      | Type    | Description                                                                              |
| ----------------------------------------- | ------- | ---------------------------------------------------------------------------------------- |
| chainID<mark style="color:red;">\*</mark> | Integer | The ID of the blockchain the token is located on (supported networks - `/v1/platforms`). |

#### Query Parameters

| Name                                            | Type   | Description                                                            |
| ----------------------------------------------- | ------ | ---------------------------------------------------------------------- |
| tokenAddress<mark style="color:red;">\*</mark>  | String | Smart contract address of the token for which access is being checked. |
| walletAddress<mark style="color:red;">\*</mark> | String | Wallet of the user for which access is being checked.                  |

{% tabs %}
{% tab title="200: OK OK" %}
{% tabs %}
{% tab title="Example" %}

```
{
  "remaining": "11579208923731620000"
}
```

{% endtab %}

{% tab title="Schema" %}

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

| Name          | Data Type | Description                                                                     |
| ------------- | --------- | ------------------------------------------------------------------------------- |
| **remaining** | `str`     | The number of tokens in decimals of the token the smart contract has access to. |

## Transaction approve

<mark style="color:blue;">`GET`</mark> `v1/{chainID}/transaction/approve`

Generates transaction input parameters to provide access to the user's tokens for the exchange smart contract.

**Request sample:**\
`https://api.yad.finance/v1/1/transaction/approve?tokenAddress=0xdAC17F958D2ee523a2206206994597C13D831ec7&amount=100000000000&gasPrice=100000000000`

#### Path Parameters

| Name                                      | Type    | Description                                                                          |
| ----------------------------------------- | ------- | ------------------------------------------------------------------------------------ |
| chainID<mark style="color:red;">\*</mark> | Integer | ID of the blockchain the token is located on (supported networks - `/v1/platforms`). |

#### Query Parameters

| Name                                           | Type    | Description                                                                                           |
| ---------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------- |
| tokenAddress<mark style="color:red;">\*</mark> | String  | Address of the smart contract of the token for which the access request is generated.                 |
| takerAddress                                   | String  | Address of user’s wallet which will provide approve. When provided the gas will be estimated exactly. |
| amount                                         | integer | The amount of user tokens to which access is granted. By default - infinite number.                   |
| gasPrice                                       | Integer | Cost of gas for an approve transaction. By default: medium                                            |
| contractAddress                                | String  | Contract that we want to give an approval. If not passed, then the default for chain is used.         |

{% tabs %}
{% tab title="200: OK OK" %}
{% tabs %}
{% tab title="Example" %}

```
{
  "calldata": "0x095ea7b30000000000000000000000001aaad07998466cd3eb8140827dddb37570be1e63000000000000000000000000000000000000000000000000000000174876e800",
  "gas_price": "100000000000",
  "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  "estimate_gas": "48561"
}
```

{% endtab %}

{% tab title="Schema" %}

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

<table><thead><tr><th>Name</th><th width="169.66666666666666">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>calldata</strong></td><td><code>str</code></td><td>One of the input parameters for processing a transaction providing access to tokens.</td></tr><tr><td><strong>gas_price</strong></td><td><code>str</code></td><td>Gas price value for a transaction in WEI.</td></tr><tr><td><strong>to</strong></td><td><code>str</code></td><td>Address of the smart contract the transaction should be sent to.</td></tr><tr><td><strong>estimate_gas</strong></td><td><code>str</code></td><td>The estimated amount of gas that will be used during the transaction.</td></tr></tbody></table>

## Get quote for pair

<mark style="color:blue;">`GET`</mark> `v1/quote`

Returns the best exchange offer and input parameters for the transaction.\
\
**Request sample:**\
`https://api.yetanotherdefi.com/v1/quote?fromChainID=1&toChainID=137&fromTokenAddress=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&toTokenAddress=0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063&takerAddress=0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503&amount=150&slippage=10&feeRecipient=0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503&sellTokenPercentageFee=10&rfqOnly=false&skipValidation=true`<br>

#### Query Parameters

| Name                                               | Type    | Description                                                                                                                                                                                                                                                 |
| -------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| fromTokenAddress<mark style="color:red;">\*</mark> | String  | Smart contract address of the sale token.                                                                                                                                                                                                                   |
| toTokenAddress<mark style="color:red;">\*</mark>   | String  | Smart contract address of the purchase token.                                                                                                                                                                                                               |
| amount<mark style="color:red;">\*</mark>           | Integer | The amount of sale tokens in decimals of the token (can be taken from the method `/tokens`).                                                                                                                                                                |
| slippage<mark style="color:red;">\*</mark>         | Number  | <p>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%).<br><br><em>Default value</em> : 1</p> |
| gasPrice                                           | String  | 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                                       | String  | Wallet address for receiving fees. The commission is paid from the purchase token.                                                                                                                                                                          |
| sellTokenPercentageFee                             | Integer | Percentage of commission from the amount of sale tokens, is taken in favor of feeRecipient. (10 = 1%, maximum value is 500).                                                                                                                                |
| rfqOnly                                            | Boolean | <p>If TRUE: use only RFQ providers for routing.</p><p><br><em>Default value</em> : false</p>                                                                                                                                                                |
| excludeAggregator                                  | String  | Exclude some aggregators from routing (add several parameters for multiple exclude).                                                                                                                                                                        |
| includeAggregator                                  | String  | Include some aggregators from routing (add several parameters for multiple include). This parameter cannot be combined with excludedAggregators.                                                                                                            |
| fromChainID<mark style="color:red;">\*</mark>      | Integer | Source/sell blockchain ID                                                                                                                                                                                                                                   |
| toChainID<mark style="color:red;">\*</mark>        | Intger  | Destination/buy blockchain ID                                                                                                                                                                                                                               |
| onchainExcludeAggregator                           | String  | Exclude some aggregators from on-chain routing (add several parameters for multiple exclude).                                                                                                                                                               |
| onchainIncludeAggregator                           | String  | Include some aggregators from on-chain routing (add several parameters for multiple include). This parameter cannot be combined with onchainExcludeAggregators.                                                                                             |
| takerAddress<mark style="color:red;">\*</mark>     | String  | The address which will fill the quote. When provided the gas will be estimated and returned.                                                                                                                                                                |
| recipientAddress                                   | String  | Percentage of commission from the amount of sell tokens, is taken in favor of feeRecipient. (10 = 1%, maximum value is 500).                                                                                                                                |
| skipValidation                                     | Boolean | <p>If TRUE: skip calldata validation</p><p></p><p><em>Default value</em> : true</p>                                                                                                                                                                         |

{% tabs %}
{% tab title="200: OK OK" %}
{% tabs %}
{% tab title="Example" %}

```json
{
  "amount_out_total": "244624",
  "estimate_gas_total": "348908",
  "token_in": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
  "token_out": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
  "gas_price": "32853665207",
  "bridge_fee": "<nil>",
  "fees": null,
  "routes": [
    {
      "type": "dex",
      "protocol_name": "native_polygon",
      "amount_in": "150",
      "amount_out": "244624",
      "percent": 100
    }
  ],
  "calldata": "0xb6aa8d2d00000000000000000000000047ac0fb4f2d84898e4d9e7b4dab3c24507a6d503000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000003b201000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000008900000000000000000000000000000000000000000000000000000000000007c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000604415565b0000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000003b1ff00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000000960000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000003556e69737761700000000000000000000000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000003b20000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c0a47dfe034b400b47bdad5fecda2621de6c4d950000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e11c8364F9E5EE0000",
  "to": "0x1AAAd07998466cD3Eb8140827DDdb37570BE1e63",
  "value": "150"
}
```

{% endtab %}

{% tab title="Schema" %}

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="204: No Content No Content" %}

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="227">Name</th><th width="110.66666666666666">Data type</th><th>Description</th></tr></thead><tbody><tr><td><strong>amount_out_total</strong></td><td><code>str</code></td><td>The amount of purchase tokens in decimals of the token.</td></tr><tr><td><strong>estimate_gas_total</strong></td><td><code>str</code></td><td>The estimated amount of gas that will be used during the transaction.</td></tr><tr><td><strong>token_in</strong></td><td><code>str</code></td><td>Smart contract address of the sale token.</td></tr><tr><td><strong>token_out</strong></td><td><code>str</code></td><td>Smart contract address of the purchase token.</td></tr><tr><td><strong>gas_price</strong></td><td><code>str</code></td><td>Gas price value for a transaction in WEI (nAVAX for Avalanche).</td></tr><tr><td><strong>bridge_fee</strong></td><td><code>str</code></td><td>Bridge protocol fee.</td></tr><tr><td><strong>fees</strong></td><td><code>array</code></td><td>Partner's fee.</td></tr><tr><td><strong>amount</strong></td><td><code>str</code></td><td>The amount of sell tokens in decimals of the token, which will be taken in favor of feeRecipient. The value will be 0 if feeRecipient and sellTokenPercentageFee fields are not specified.</td></tr><tr><td><strong>recipient</strong></td><td><code>str</code></td><td>Wallet address for receiving fees. The commission is paid from the purchase token.</td></tr><tr><td><strong>token</strong></td><td><code>str</code></td><td>Address of fee token.</td></tr><tr><td><strong>routes</strong></td><td><code>array</code></td><td>An array of DEXs the transaction will be carried out through.</td></tr><tr><td><strong>type</strong></td><td><code>str</code></td><td>Liquidity source type.</td></tr><tr><td><strong>protocol_name</strong></td><td><code>str</code></td><td>DEX name the transaction will be carried out through.</td></tr><tr><td><strong>percent</strong></td><td><code>int</code></td><td>The percent of amount will be swapped on the current DEX.</td></tr><tr><td><strong>calldata</strong></td><td><code>str</code></td><td>One of the input parameters for processing a transaction for tokens exchange.</td></tr><tr><td><strong>to</strong></td><td><code>str</code></td><td>Smart contract address where input parameters should be sent to.</td></tr><tr><td><strong>value</strong></td><td><code>str</code></td><td>ETH value that must be transferred along with the transaction in order for it to be successful.</td></tr></tbody></table>

## List tokens

<mark style="color:green;">`POST`</mark> `v2/tokens/list`

Get a list of tokens with filters and pagination.

**Request sample**

cURL:

`curl -X 'POST' \` \
`'https://api.yetanotherdefi.com/v2/tokens/list' \` \
`-H 'accept: application/json' \` \
`-H 'Content-Type: application/json' \` \
`-d '{ "filter": { "symbols": [ "ETH" ] }, "paging": { "page": 1, "page_size": 100 } }'`

#### Request Body

| Name                                   | Type          | Description                                                                                                                                                                                                                                                                                               |
| -------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filter                                 | object        | <p>Filtering occurs with an 'AND' statement between fields and an 'OR' statement between array elements. </p><p></p><p>For example: chain\_ids\[1, 2], names\[asd] == all tokens where chain\_id is "1" or "2" and name equal "asd". </p><p></p><p>Searching by all text filters is case-insensitive.</p> |
| addresses                              | string array  | Token smart contract addresses.                                                                                                                                                                                                                                                                           |
| chain\_ids                             | integer array | Blockchain network IDs.                                                                                                                                                                                                                                                                                   |
| is\_active                             | boolean       | <p>FALSE = the token is rarely used in exchanges on DEXs</p><p></p><p>If null - get only active.</p>                                                                                                                                                                                                      |
| names                                  | string array  | Full names of tokens.                                                                                                                                                                                                                                                                                     |
| symbols                                | string array  | Abbreviated names of tokens.                                                                                                                                                                                                                                                                              |
| paging                                 | object        | An object for adjusting response sizes.                                                                                                                                                                                                                                                                   |
| page<mark style="color:red;">\*</mark> | integer       | <p>Page number. </p><p></p><p>This parameter can be useful when the total sample size of tokens that meet the criteria from the filter exceeds the page size.</p><p></p><p>Can't be less than 1.</p>                                                                                                      |
| page\_size                             | integer       | <p>Response size. For example, "page\_size": 5 == get 5 tokens that meet the filtering conditions.</p><p></p><p>Max 100. If zero - unlitimited page size</p>                                                                                                                                              |

{% tabs %}
{% tab title="200: OK OK" %}
{% tabs %}
{% tab title="Example" %}

```json
{
  "tokens": [
    {
      "chainId": 1,
      "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
      "name": "Ethereum",
      "symbol": "ETH",
      "decimals": 18,
      "logoURI": "https://cl.yad.finance/static-files/1i/1/0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee/48x48.png",
      "is_active": true,
      "priority": 1,
      "is_rfq_mode": false
    },
    {
      "chainId": 10,
      "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
      "name": "Ethereum",
      "symbol": "ETH",
      "decimals": 18,
      "logoURI": "https://cl.yad.finance/static-files/1i/10/0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee/48x48.png",
      "is_active": true,
      "priority": 1,
      "is_rfq_mode": false
    }
  ]
}
```

{% endtab %}

{% tab title="Schema" %}

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

| Name              | Data type | Description                                                                                                                                                                     |
| ----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **tokens**        | `array`   | An array of tokens.                                                                                                                                                             |
| **chainId**       | `int`     | The blockchain network ID.                                                                                                                                                      |
| **address**       | `str`     | The token smart contract address.                                                                                                                                               |
| **name**          | `str`     | Full name of the token.                                                                                                                                                         |
| **symbol**        | `str`     | Abbreviated name of the token.                                                                                                                                                  |
| **decimals**      | `int`     | The number of decimals used to get its user representation. For example, if decimals equals 2, a balance of 505 tokens should be displayed to a user as 5.05 (505 / 10 \*\* 2). |
| **logoURI**       | `str`     | A link to the token logo.                                                                                                                                                       |
| **is\_active**    | `boolean` | FALSE = the token is rarely used in exchanges on DEXs.                                                                                                                          |
| **priority**      | `int`     | Recommended priority of a token to be shown to the user, based on the popularity of the token.                                                                                  |
| **is\_rfq\_mode** | `boolean` | TRUE = the token is supported by RFQ providers.                                                                                                                                 |


---

# 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://docs.yad.finance/integration-guides/cross-chain-swaps-api/endpoint-list.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.
