# Pool v2

This endpoint provides comprehensive information about all the pools on the selected chain, including details about its assets, the contract address of its liquidity pool, and other relevant data. This information is crucial for making off-chain calculations and predicting quotes.

### URL

```url
https://blade-api.sushi.com/rfq/v2/pool/{CHAIN_ID}
```

## Request

| Path Param | Description                                  | Example       |
| ---------- | -------------------------------------------- | ------------- |
| chain      | <p>Integer - Required<br>ID of the chain</p> | chain\_id=137 |

<table><thead><tr><th width="178.33333333333331">Query Param</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>pool_address</td><td>str - Optional<br>The address of the pool. If not provided, all pools on the selected chain will be returned.</td><td>pool_address=0x655eDCE464CC797526600a462A8154650EEe4B77</td></tr><tr><td>time_in_seconds</td><td><p>Integer - Optional</p><p>The time duration for which a quote will be available. This value is used to calculate the fees; as you decrease the time, you will see lower fees.</p><p>By default, the system sets a predefined value. </p><p><strong>Note:</strong> For on-chain data, this field is not considered.</p></td><td>time_in_seconds=30</td></tr><tr><td>fieldset</td><td><p>String - Optional<br>Determines whether the API should make calls to the blockchain to return on-chain data.</p><p><strong>Accepted Value</strong>: <mark style="color:orange;"><code>offchain-data</code></mark> If the parameter is not provided, it will default to handling on-chain data.</p></td><td>fieldset=offchain-data</td></tr></tbody></table>

## Response

#### On-chain object

<table><thead><tr><th width="133">Field</th><th>Description</th></tr></thead><tbody><tr><td>pools</td><td>List of <a href="#pool-data-on-chain-object">Pool data on-chain object</a></td></tr><tr><td>pool_type</td><td>String - <mark style="color:orange;"><code>offchain</code></mark></td></tr></tbody></table>

#### Pool Data on-chain object

<table><thead><tr><th width="133">Field</th><th>Description</th></tr></thead><tbody><tr><td>pool</td><td><a href="#pool-on-chain-object">Pool on-chain object</a></td></tr><tr><td>assets</td><td>List of <a href="#asset-o-chain-object">Asset on-chain objects</a></td></tr></tbody></table>

#### Pool on-chain object

<table><thead><tr><th width="248">Field</th><th>Description</th></tr></thead><tbody><tr><td>chain_id</td><td>Integer - ID of the chain</td></tr><tr><td>address</td><td>String(ETH address) - Clipper contract address of the pool, is the address used when executing a transaction</td></tr><tr><td>num_assets</td><td>Integer - The total of assets available in the chain</td></tr><tr><td>value_in_usd</td><td>Float - Value of the pool in USD (***REVIEW TEMO)</td></tr><tr><td>swaps_enabled</td><td>Bool - Represents if the swaps are available for the chain</td></tr></tbody></table>

#### Asset on-chain object

<table><thead><tr><th width="158">Field</th><th>Description</th></tr></thead><tbody><tr><td>name</td><td>String - The name of the asset, this value should be used when making a quote</td></tr><tr><td>address</td><td>String(ETH address) - The contract address of the asset</td></tr><tr><td>price_in_usd</td><td>Float - Current price in dollars for the asset</td></tr><tr><td>value_in_usd</td><td>Float - Value of the pool in USD</td></tr><tr><td>target_value_in_usd</td><td>Float - USD target value for this asset in the pool</td></tr></tbody></table>

#### Off-chain object

<table><thead><tr><th width="133">Field</th><th>Description</th></tr></thead><tbody><tr><td>pools</td><td>List of <a href="#pool-data-off-chainobject">Pool data off-chain object</a></td></tr><tr><td>pool_type</td><td>String - <mark style="color:orange;"><code>offchain</code></mark></td></tr></tbody></table>

#### Pool Data off-chain object

<table><thead><tr><th width="133">Field</th><th>Description</th></tr></thead><tbody><tr><td>pool</td><td><a href="#pool-off-chain-object">Pool off-chain object</a></td></tr><tr><td>assets</td><td>List of <a href="#asset-off-chainobject">Asset off-chain objects</a></td></tr><tr><td>pairs</td><td>List of <a href="#pair-object">Pair objects</a></td></tr></tbody></table>

#### Pool off-chain object

<table><thead><tr><th width="248">Field</th><th>Description</th></tr></thead><tbody><tr><td>chain_id</td><td>Integer - ID of the chain</td></tr><tr><td>address</td><td>String(ETH address) - Clipper contract address of the pool, is the address used when executing a transaction</td></tr><tr><td>num_assets</td><td>Integer - The total of assets available in the chain</td></tr><tr><td>k</td><td>Float - K factor</td></tr><tr><td>time_in_seconds</td><td>Integer - Number of seconds were used to calculate the fees of a swap, this number indicates the number of seconds that quotes are live</td></tr><tr><td>default_time_in_seconds</td><td>Integer - Default number of seconds that quotes are live, is value used to calculate fees when don't send the query param <mark style="color:orange;"><code>time_in_seconds</code></mark></td></tr><tr><td>swaps_enabled</td><td>Bool - Represents if the swaps are available for the chain</td></tr></tbody></table>

#### Asset off-chain object

<table><thead><tr><th width="158">Field</th><th>Description</th></tr></thead><tbody><tr><td>name</td><td>String - The name of the asset, this value should be used when making a quote</td></tr><tr><td>address</td><td>String(ETH address) - The contract address of the asset</td></tr><tr><td>price_in_usd</td><td>Float - Current price in dollars for the asset</td></tr><tr><td>listing_weight</td><td>Integer - asset weight within the pool</td></tr></tbody></table>

#### Pair object

<table><thead><tr><th width="201">Field</th><th>Description</th></tr></thead><tbody><tr><td>assets</td><td>List[str] - Pair of assets available to make a swap - e.g: ["ETH", "MATIC"]</td></tr><tr><td>fee_in_basis_points</td><td>Float - Fee for make a swap between the pair</td></tr></tbody></table>

## Examples

1.Get the offchain data for Polygon chain (chain\_id=137)

***Request***

<pre class="language-bash" data-overflow="wrap" data-full-width="false"><code class="lang-bash"><strong>curl -X GET "https://blade-api.sushi.com/rfq/v2/pool/1?fieldset=offchain-data" -H "x-api-key: mQzA8Uy6nZ8Vy"
</strong></code></pre>

***Response***

```json
{
  "pool_type": "offchain",
  "pools": [
    {
      "pool": {
        "chain_id": 1,
        "address": "0x655eDCE464CC797526600a462A8154650EEe4B77",
        "num_assets": 4,
        "k": 0.06,
        "time_in_seconds": 60,
        "default_time_in_seconds": 60,
        "swaps_enabled": true
      },
      "assets": [
        {
          "name": "ETH",
          "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
          "price_in_usd": 2076.799,
          "listing_weight": 79
        },
        {
          "name": "USDC",
          "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "price_in_usd": 1,
          "listing_weight": 188
        },
        {
          "name": "USDT",
          "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
          "price_in_usd": 1,
          "listing_weight": 305
        },
        {
          "name": "DAI",
          "address": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
          "price_in_usd": 1,
          "listing_weight": 250
        }
      ],
      "pairs": [
        {
          "assets": [
            "ETH",
            "USDC"
          ],
          "fee_in_basis_points": 9
        },
        {
          "assets": [
            "ETH",
            "USDT"
          ],
          "fee_in_basis_points": 9
        },
        {
          "assets": [
            "ETH",
            "DAI"
          ],
          "fee_in_basis_points": 8
        },
        {
          "assets": [
            "USDC",
            "USDT"
          ],
          "fee_in_basis_points": 5
        },
        {
          "assets": [
            "USDC",
            "DAI"
          ],
          "fee_in_basis_points": 5
        },
        {
          "assets": [
            "USDT",
            "DAI"
          ],
          "fee_in_basis_points": 5
        }
      ]
    }
  ]
}
```

2. Get the on-chain data for mainnet chain (chain\_id=1)

***Request***

{% code overflow="wrap" %}

```bash
curl -X GET "https://blade-api.sushi.com/rfq/v2/pool/1?pool_address=0x655eDCE464CC797526600a462A8154650EEe4B77" -H "x-api-key: mQzA8Uy6nZ8Vy"
```

{% endcode %}

***Response***

```json
{
  "pool_type": "onchain",
  "pools": [
    {
      "pool": {
        "chain_id": 1,
        "address": "0x655eDCE464CC797526600a462A8154650EEe4B77",
        "num_assets": 4,
        "pool_tokens": 1.3792871898369242e+24,
        "value_in_usd": 1978682.496424432,
        "swaps_enabled": true
      },
      "assets": [
        {
          "name": "USDC",
          "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "balance": "417751254142",
          "price_in_usd": 1,
          "value_in_usd": 417751.254142,
          "target_value_in_usd": 416727.89356391726
        },
        {
          "name": "USDT",
          "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
          "balance": "259059412007",
          "price_in_usd": 1,
          "value_in_usd": 259059.412007,
          "target_value_in_usd": 256868.3409508736
        },
        {
          "name": "DAI",
          "address": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
          "balance": "309714519494182375269440",
          "price_in_usd": 1,
          "value_in_usd": 309714.5194941824,
          "target_value_in_usd": 313379.3759600658
        },
        {
          "name": "ETH",
          "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
          "balance": "476877882758190421102",
          "price_in_usd": 2080.527,
          "value_in_usd": 992157.3107812497,
          "target_value_in_usd": 991706.8859495752
        }
      ]
    }
  ]
}
```
