Skip to main content
Glama

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
NameRequiredDescriptionDefault
chainNoFilter by blockchain network
base_tokenNoFilter by base token symbol (e.g. WETH)
quote_tokenNoFilter by quote token symbol (e.g. USDC)
limitNoMaximum results (default 25)

Implementation Reference

  • 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}` }],
        };
      },
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/carrierone/verilexdata-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server