DEX Dataset Statistics
dex_statsRetrieve DEX trading statistics including total trades, pairs tracked, chains, protocols covered, and last update timestamp.
Instructions
Get statistics about the DEX trading dataset: total trades, pairs tracked, chains and protocols covered, last updated. Free endpoint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/dex.ts:287-308 (handler)Handler function for the dex_stats tool. Calls GET /api/v1/dex/stats and returns JSON-formatted dataset statistics (total trades, pairs tracked, chains, protocols, last updated). No input parameters required.
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)TypeScript interface DexStatsResponse defining the response shape: dataset name, source, update_frequency, and stats (a generic record).
interface DexStatsResponse { dataset: string; source: string; update_frequency: string; stats: Record<string, unknown>; } - src/tools/dex.ts:278-286 (registration)Registration of dex_stats tool on the MCP server via server.registerTool(). Name: 'dex_stats', title: 'DEX Dataset Statistics', description mentions it's a free endpoint. Input schema is empty (no params).
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: {}, }, - src/index.ts:52-52 (registration)Top-level registration: registerDexTools(server) called in index.ts to wire up all DEX tools including dex_stats.
registerDexTools(server);