query_dex_pairs
Find decentralized exchange trading pairs with filtering options. Get pair details including liquidity and volume data from on-chain analytics.
Instructions
List available trading pairs on decentralized exchanges. Filter by chain, base token, or quote token. Returns pair details with liquidity and volume. Cost: $0.001 per query. Source: On-chain DEX analytics.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | Filter by blockchain network | |
| base_token | No | Filter by base token symbol (e.g. WETH) | |
| quote_token | No | Filter by quote token symbol (e.g. USDC) | |
| limit | No | Maximum results (default 25) |
Implementation Reference
- src/tools/dex.ts:101-160 (handler)Registration and handler implementation for "query_dex_pairs" tool.
server.registerTool( "query_dex_pairs", { title: "Query DEX Pairs", description: "List available trading pairs on decentralized exchanges. Filter by chain, " + "base token, or quote token. Returns pair details with liquidity and volume. " + "Cost: $0.001 per query. Source: On-chain DEX analytics.", inputSchema: { chain: z .enum(["ethereum", "arbitrum", "polygon", "base", "bsc"]) .optional() .describe("Filter by blockchain network"), base_token: z .string() .optional() .describe("Filter by base token symbol (e.g. WETH)"), quote_token: z .string() .optional() .describe("Filter by quote token symbol (e.g. USDC)"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 25)"), }, }, async ({ chain, base_token, quote_token, limit }) => { const res = await apiGet<DexQueryResponse>("/api/v1/dex/pairs", { chain, base_token, quote_token, limit: limit ?? 25, }); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } const { count, data } = res.data; const warn = stalenessWarning(res); const summary = `${warn}Found ${count} DEX pair(s).`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, );