getPoolTransactions
Retrieve recent transactions for a specific pool, including swaps, adds, and removes. Specify network and pool address to access detailed activity data, with options for pagination and cursor-based navigation.
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 |
|---|---|---|---|
| cursor | No | Transaction ID used for cursor-based pagination | |
| limit | No | Number of items per page (max 100) | |
| network | Yes | Network ID from getNetworks (e.g., "ethereum", "solana") | |
| page | No | Page number for pagination (up to 100 pages) | |
| poolAddress | Yes | Pool address or identifier |
Implementation Reference
- src/index.js:228-235 (handler)The handler function that constructs the DexPaprika API endpoint for retrieving transactions of a specific pool on a network, fetches the data using the helper fetchFromAPI, and formats it with formatMcpResponse for MCP response.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:221-227 (schema)Zod schema defining the input parameters for the getPoolTransactions tool, including required network and poolAddress, and optional pagination parameters.{ 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:218-236 (registration)The server.tool registration call that defines the 'getPoolTransactions' tool, including its 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); } );
- src/index.js:10-34 (helper)Shared helper function used by getPoolTransactions (and other tools) to make API requests to DexPaprika with comprehensive error handling for common issues like 410 (deprecated endpoints) and 429 (rate limits).async function fetchFromAPI(endpoint) { try { const response = await fetch(`${API_BASE_URL}${endpoint}`); if (!response.ok) { if (response.status === 410) { throw new Error( 'This endpoint has been permanently removed. Please use network-specific endpoints instead. ' + 'For example, use /networks/{network}/pools instead of /pools. ' + 'Get available networks first using the getNetworks function.' ); } if (response.status === 429) { throw new Error( 'Rate limit exceeded. You have reached the maximum number of requests allowed for the free tier. ' + 'To increase your rate limits and access additional features, please consider upgrading to a paid plan at https://docs.dexpaprika.com/' ); } throw new Error(`API request failed with status ${response.status}`); } return await response.json(); } catch (error) { console.error(`Error fetching from API: ${error.message}`); throw error; } }
- src/index.js:37-46 (helper)Shared helper function used by getPoolTransactions (and other tools) to format API responses into the MCP-standard text content structure.function formatMcpResponse(data) { return { content: [ { type: "text", text: JSON.stringify(data) } ] }; }