# get\_reserves

This on-chain view returns reserves (token A and token B) in a specific liquidity pool (pair). Also can return a list of responses for a list of requests.

### Call parameters

```pascaligo
type token_id_t         is nat

type reserves_req_t     is token_id_t

list(reserves_req_t)
```

<table><thead><tr><th width="150">Field</th><th width="202.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>reserves_req_t</td><td>token_id_t (nat)</td><td>Pair ID for which you need to get reserves</td></tr></tbody></table>

### Return type

```pascaligo
type token_id_t         is nat

type reserves_t         is [@layout:comb] record [
  token_a_pool            : nat;
  token_b_pool            : nat;
]

type reserves_req_t     is token_id_t

type reserves_res_t     is [@layout:comb] record [
  request                 : reserves_req_t;
  reserves                : reserves_t;
]

list(reserves_res_t)
```

#### reserves\_t

<table><thead><tr><th>Field</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>token_a_pool</td><td>nat</td><td>Amount of token A in the liquidity pool (pair)</td></tr><tr><td>token_b_pool</td><td>nat</td><td>Amount of token B in the liquidity pool (pair)</td></tr></tbody></table>

#### reserves\_res\_t

<table><thead><tr><th width="150">Field</th><th width="152.00000000000003">Type</th><th>Description</th></tr></thead><tbody><tr><td>request</td><td>reserves_req_t (nat)</td><td>Pair ID for which you need to get a reserves</td></tr><tr><td>reserves</td><td><a href="#reserves_t">reserves_t</a></td><td>Reserves of tokens in a liquidity pool (pair)</td></tr></tbody></table>

### Usage

{% tabs %}
{% tab title="🌮 Taquito" %}

```javascript
const dexCoreAddress = "KT1...";
const params = [0, 1, 15];
const viewCaller = "tz1...";
const dexCore = await tezos.contract.at(dexCoreAddress);
const reserves = await dexCore.contract.contractViews.get_reserves(params).executeView({ viewCaller: viewCaller });
```

{% endtab %}
{% endtabs %}

### Errors

* `108` - pair (pool) with the specified `token_id` not listed.


---

# 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.quipuswap.com/smart-contracts/dex-2.0/dexcore-contract/on-chain-views-overview/get_reserves.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.
