> For the complete documentation index, see [llms.txt](https://pangeaswap.gitbook.io/pangeaswap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pangeaswap.gitbook.io/pangeaswap/developers/interacting-with-the-protocol/undefined-1.md).

# 판게아 풀 정보 가져오기

현재 판게아에 배포되어 있는 모든 풀의 정보를 가져오는 예제입니다.

```typescript

/// MasterDeployer__factory는 판게아 프로토콜의 types/ 내에 있는 typechain 객체입니다. 
/// typechain와 ethers.js를 통해 JS 환경에서 간편하게 interaction할 수 있습니다.
import {ConcentratedLiquidityPool__factory, MasterDeployer__factory} from "./types";
import {ethers} from "ethers";

// baobab 환경의 경우
// * provider의 URL => https://public-node-api.klaytnapi.com/v1/baobab
// * masterDeployerAddress => 0x899d8Ff3d3BD16DBE4eFF245BdA27EF96C01044B
const provider = new ethers.providers.JsonRpcProvider("https://public-node-api.klaytnapi.com/v1/cypress");
const masterDeployerAddress = "0xEB4B1CE03bb947Ce23ABd1403dF7C9B86004178d";

async function readAllPools() {  
  const masterDeployer = await MasterDeployer__factory.connect(
      masterDeployerAddress, provider
  );

  /// 판게아에서 배포되어 있는 풀 갯수
  const totalPools = (await masterDeployer.totalPoolsCount()).toNumber();

  for (let i = 0; i < totalPools; i++) {
    /// 판게아의 풀 주소 가져오기
    const poolAddress = await masterDeployer.getPoolAddress(i);
    const pool = await ConcentratedLiquidityPool__factory.connect(
        poolAddress, provider
    );
    
    const [
      token0,  /// 풀의 두 토큰 중 토큰0의 주소
      token1,  /// 풀의 두 토큰 중 토큰1의 주소
      swapFee, /// 스왑 수수료
      reserves /// 풀에 있는 두 토큰의 reserve
    ] = await Promise.all([
        pool.token0(), pool.token1(), pool.swapFee(), pool.getReserves()
    ])

    console.log(`${poolAddress} | ${token0} | ${token1} | ${swapFee / 1e6}% | ${reserves} | ${reserves._reserve1}`);
  }
}

readAllPools();
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://pangeaswap.gitbook.io/pangeaswap/developers/interacting-with-the-protocol/undefined-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
