read.pool.info
Retrieve detailed lending pool information including APY history. Analyze rate trends and compare pools using pool address.
Instructions
Get detailed info for a single lending pool including APY history over time. Useful for analyzing rate trends and comparing pools. Use read.pool.list to discover pool addresses.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pool_address | Yes | Pool address | |
| days | No | Number of days of APY history | |
| chain_id | No | Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pool | Yes | ||
| apy_history | Yes |
Implementation Reference
- src/tools/read/pools.ts:57-120 (handler)Tool handler for 'read.pool.info' – fetches pool details and APY history. Takes chain_id, pool_address, and days parameters. Calls api.getPools() to find pool metadata and api.getPoolApyHistory() for APY trend data, returns combined result with error handling.
server.registerTool( "read.pool.info", { annotations: { title: "Get Pool Info", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, description: "Get detailed info for a single lending pool including APY history over time. Useful for analyzing rate trends and comparing pools. Use read.pool.list to discover pool addresses.", inputSchema: { pool_address: z.string().describe("Pool address"), days: z.number().default(14).describe("Number of days of APY history"), chain_id: z.number().default(8453).describe(CHAIN_ID_DESCRIPTION), }, outputSchema: PoolDetailOutput, }, async ({ pool_address, days, chain_id }) => { try { const [allPools, apy_history] = await Promise.all([ api.getPools(chain_id), api.getPoolApyHistory(chain_id, pool_address, days), ]); const poolList = Array.isArray(allPools) ? allPools : ((allPools as Record<string, unknown>).data as unknown[]); const pool = Array.isArray(poolList) ? (poolList as Record<string, unknown>[]).find( (p) => ((p.address ?? p.pool_address) as string)?.toLowerCase() === pool_address.toLowerCase(), ) : null; if (!pool) { return { content: [ { type: "text" as const, text: `Error: Pool ${pool_address} not found on chain ${chain_id}.`, }, ], isError: true, }; } const detail = { pool, apy_history }; return { content: [{ type: "text" as const, text: JSON.stringify(detail, null, 2) }], structuredContent: detail, }; } catch (err) { return { content: [ { type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } }, ); - src/tools/output-schemas.ts:123-126 (schema)Output schema (PoolDetailOutput) for the read.pool.info tool – defines response shape with pool metadata and APY history array.
export const PoolDetailOutput = z.object({ pool: z.record(z.unknown()), apy_history: z.array(z.record(z.unknown())), }); - src/tools/index.ts:41-41 (registration)Registration call in the main index – registerPoolTools is invoked with the server and api instances, which registers both read.pool.list and read.pool.info tools.
registerPoolTools(server, api); - src/clients/api.ts:160-166 (helper)Helper method getPoolApyHistory on ArcadiaApiClient – makes GET request to /pools/historic_apy with chain_id, pool_address, and days to fetch APY history data used by read.pool.info.
async getPoolApyHistory(chainId: number, poolAddress: string, days = 14) { return this.get("/pools/historic_apy", { chain_id: chainId, pool_address: poolAddress, days, }); } - src/clients/api.ts:150-152 (helper)Helper method getPools on ArcadiaApiClient – makes GET request to /pools with chain_id to fetch all pools, used by read.pool.info to find the specific pool by address.
async getPools(chainId: number) { return this.get<ApiListResponse>("/pools", { chain_id: chainId }); }