> For a complete index of Agora Finance documentation, fetch https://docs.agora.finance/llms.txt

# Fetching Pair Reserves

> Read current reserve balances for a trading pair to check available liquidity

Fetching live reserves is useful for knowing the liquidity on each side of the pair before you trade.

> **Note**
>
> If you want to run this example, be sure that you have followed the steps [here](/instant-settlement/guides/quick-start#setting-up-a-viem-wallet-client) to configure your Wallet Client.

* If you are following our example using the Sepolia Explorer, you can use the CTK/AUSD pair address [`0x1Aa8958Aa34cEC8096EF4381cb335effe977b0ae`](https://sepolia.etherscan.io/address/0x1aa8958aa34cec8096ef4381cb335effe977b0ae#readProxyContract).
* If you are trying to swap in a mainnet chain, you can check out [Find all available Pairs](/instant-settlement/guides/fetching-all-pairs)

## Pick a pair address

```tsx
// AUSD / CTK pair on Sepolia
const TESTNET_PAIR_AUSD_CTK = '0x1Aa8958Aa34cEC8096EF4381cb335effe977b0ae';
```

In order to query the reserves from the contract, we'll call the methods `reserve0` and `reserve1`

## Helper function to read raw reserves

```tsx
/**
 * Returns the raw on-chain reserves (no decimal conversion).
 */
async function getPairReserves(
  pair: `0x${string}`,
): Promise<{ reserve0: bigint; reserve1: bigint }> {
  const reserve0 = await client.readContract({
    address: pair,
    abi: instantSettlementAbi,
    functionName: "reserve0",
  });

  const reserve1 = await client.readContract({
    address: pair,
    abi: instantSettlementAbi,
    functionName: "reserve1",
  });

  return { reserve0, reserve1 };
}
```

## Example use of the helper function

```tsx
(async () => {
  const { reserve0, reserve1 } = await getPairReserves(TESTNET_PAIR_AUSD_CTK);

  console.log(`Reserves token0 (AUSD – 6 dec):`, reserve0);
  console.log(`Reserves token1 (CTK  – 18 dec):`, reserve1);
})();
```

### Returned Data

```tsx
Reserves token0 (AUSD – 6 dec): 1000000000000n
Reserves token1 (CTK  – 18 dec): 1000000000000000000000000n
```

This is the value stored by the contract. In order to convert these units to human readable values, we'll need to divide the output by the [`ERC20`](https://eips.ethereum.org/EIPS/eip-20) token decimals.