getPoolTransactions
Retrieve recent swap, add, and remove transactions for a specific liquidity pool on supported blockchains to monitor trading activity and analyze pool dynamics.
Instructions
Get recent transactions for a specific pool. Shows swaps, adds, removes. Requires network and pool address.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | Yes | Network ID from getNetworks (e.g., "ethereum", "solana") | |
| poolAddress | Yes | Pool address or identifier | |
| page | No | Page number for pagination (up to 100 pages) | |
| limit | No | Number of items per page (max 100) | |
| cursor | No | Transaction ID used for cursor-based pagination |
Implementation Reference
- src/index.js:222-229 (handler)The handler function for the getPoolTransactions tool. It constructs an API endpoint based on the input parameters (network, poolAddress, page, limit, cursor) and fetches transaction data using fetchFromAPI, then formats it with formatMcpResponse.async ({ network, poolAddress, page, limit, cursor }) => { let endpoint = `/networks/${network}/pools/${poolAddress}/transactions?page=${page}&limit=${limit}`; if (cursor) { endpoint += `&cursor=${encodeURIComponent(cursor)}`; } const data = await fetchFromAPI(endpoint); return formatMcpResponse(data); }
- src/index.js:215-221 (schema)The input schema for the getPoolTransactions tool, defined using Zod (z.object implied), with parameters for network, poolAddress, page, limit, and optional cursor.{ network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'), poolAddress: z.string().describe('Pool address or identifier'), page: z.number().optional().default(0).describe('Page number for pagination (up to 100 pages)'), limit: z.number().optional().default(10).describe('Number of items per page (max 100)'), cursor: z.string().optional().describe('Transaction ID used for cursor-based pagination') },
- src/index.js:212-230 (registration)The registration of the getPoolTransactions tool using server.tool(), including the tool name, description, input schema, and inline handler function.server.tool( 'getPoolTransactions', 'Get recent transactions for a specific pool. Shows swaps, adds, removes. Requires network and pool address.', { network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'), poolAddress: z.string().describe('Pool address or identifier'), page: z.number().optional().default(0).describe('Page number for pagination (up to 100 pages)'), limit: z.number().optional().default(10).describe('Number of items per page (max 100)'), cursor: z.string().optional().describe('Transaction ID used for cursor-based pagination') }, async ({ network, poolAddress, page, limit, cursor }) => { let endpoint = `/networks/${network}/pools/${poolAddress}/transactions?page=${page}&limit=${limit}`; if (cursor) { endpoint += `&cursor=${encodeURIComponent(cursor)}`; } const data = await fetchFromAPI(endpoint); return formatMcpResponse(data); } );