dex_stats
Retrieve DEX trading dataset statistics including total trades, pairs tracked, chains and protocols covered, and last update information.
Instructions
Get statistics about the DEX trading dataset: total trades, pairs tracked, chains and protocols covered, last updated. Free endpoint.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/dex.ts:287-308 (handler)The handler for 'dex_stats', which calls the '/api/v1/dex/stats' endpoint and returns the statistics as a JSON string.
async () => { const res = await apiGet<DexStatsResponse>("/api/v1/dex/stats"); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } return { content: [ { type: "text" as const, text: JSON.stringify(res.data, null, 2) }, ], }; }, ); - src/tools/dex.ts:278-308 (registration)The registration of the 'dex_stats' tool within the MCP server.
server.registerTool( "dex_stats", { title: "DEX Dataset Statistics", description: "Get statistics about the DEX trading dataset: total trades, pairs tracked, " + "chains and protocols covered, last updated. Free endpoint.", inputSchema: {}, }, async () => { const res = await apiGet<DexStatsResponse>("/api/v1/dex/stats"); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } return { content: [ { type: "text" as const, text: JSON.stringify(res.data, null, 2) }, ], }; }, ); - src/tools/dex.ts:22-27 (schema)Interface defining the structure of the response for the 'dex_stats' tool.
interface DexStatsResponse { dataset: string; source: string; update_frequency: string; stats: Record<string, unknown>; }