Skip to main content
Glama

query_dex_volume

Retrieve DEX trading pair volume statistics including 24h and 7d volume, trade counts, and volume trends across multiple blockchain networks.

Instructions

Get volume statistics for DEX trading pairs. Shows 24h volume, 7d volume, trade count, and volume trends by pair and chain. Cost: $0.005 per query. Source: On-chain DEX analytics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pairNoTrading pair (e.g. WETH-USDC)
chainNoFilter by blockchain network
periodNoVolume aggregation period (default: 24h)
limitNoMaximum results (default 25)

Implementation Reference

  • The `query_dex_volume` tool is defined here, including its input schema and the handler that fetches data from the `/api/v1/dex/volume` endpoint.
    server.registerTool(
      "query_dex_volume",
      {
        title: "Query DEX Volume",
        description:
          "Get volume statistics for DEX trading pairs. Shows 24h volume, 7d volume, " +
          "trade count, and volume trends by pair and chain. " +
          "Cost: $0.005 per query. Source: On-chain DEX analytics.",
        inputSchema: {
          pair: z
            .string()
            .optional()
            .describe("Trading pair (e.g. WETH-USDC)"),
          chain: z
            .enum(["ethereum", "arbitrum", "polygon", "base", "bsc"])
            .optional()
            .describe("Filter by blockchain network"),
          period: z
            .enum(["24h", "7d", "30d"])
            .optional()
            .describe("Volume aggregation period (default: 24h)"),
          limit: z
            .number()
            .int()
            .min(1)
            .max(100)
            .optional()
            .describe("Maximum results (default 25)"),
        },
      },
      async ({ pair, chain, period, limit }) => {
        const res = await apiGet<DexQueryResponse>("/api/v1/dex/volume", {
          pair,
          chain,
          period: period ?? "24h",
          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 volume record(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