Skip to main content
Glama
PaulieB14

Limitless MCP

get_daily_protocol_stats

Retrieve daily protocol statistics including volume, trades, fees, splits, merges, and redemptions as a time series to analyze market performance.

Instructions

Get daily protocol stats (volume, trades, fees, splits, merges, redemptions) across both market types as a time series.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoNumber of days to return

Implementation Reference

  • The handler for the 'get_daily_protocol_stats' tool. It queries both market types for daily snapshots, merges the data by dayId, and returns the aggregated time series.
    async ({ days }) => {
      try {
        const snapshotQuery = `{
          globalDailySnapshots(first: ${days}, orderBy: dayId, orderDirection: desc) {
            dayId date totalTradesCount totalVolumeUSD totalFeesUSD
            totalSplits totalMerges totalRedemptions
          }
        }`;
    
        const { simple, negrisk } = await queryBoth(snapshotQuery, snapshotQuery);
    
        // Merge by dayId
        const merged = new Map<number, any>();
        for (const s of simple.globalDailySnapshots || []) {
          merged.set(s.dayId, {
            dayId: s.dayId,
            date: s.date,
            simpleTradesCount: s.totalTradesCount,
            simpleVolumeUSD: s.totalVolumeUSD,
            simpleFeesUSD: s.totalFeesUSD,
            simpleSplits: s.totalSplits,
            simpleMerges: s.totalMerges,
            simpleRedemptions: s.totalRedemptions,
            negriskTradesCount: "0",
            negriskVolumeUSD: "0",
            negriskFeesUSD: "0",
            negriskSplits: "0",
            negriskMerges: "0",
            negriskRedemptions: "0",
          });
        }
        for (const n of negrisk.globalDailySnapshots || []) {
          const existing = merged.get(n.dayId);
          if (existing) {
            existing.negriskTradesCount = n.totalTradesCount;
            existing.negriskVolumeUSD = n.totalVolumeUSD;
  • Registration of the 'get_daily_protocol_stats' tool in the MCP server.
    server.registerTool(
      "get_daily_protocol_stats",
      {
        description:
          "Get daily protocol stats (volume, trades, fees, splits, merges, redemptions) across both market types as a time series.",
        inputSchema: {
          days: z.number().default(30).describe("Number of days to return"),
        },
      },

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/PaulieB14/limitless-subgraphs'

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