Skip to main content
Glama

pot_stats

Retrieve Proof of Time statistics including total swaps, turbo/full counts, and turbo ratio for specified time periods (day, week, month).

Instructions

Get PoT statistics: total swaps, turbo/full counts, and turbo ratio for a given period.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodYesTime period for statistics

Implementation Reference

  • The implementation of the pot_stats tool, which calculates statistics about Proof of Time (PoT) anchors over a given period based on the in-memory log.
    // ---------- Tool: pot_stats ----------
    
    export async function potStats(args: {
      period: "day" | "week" | "month";
    }): Promise<unknown> {
      telemetryIncrement("pot_stats");
    
      const now = Date.now();
      const periodMs: Record<string, number> = {
        day: 86400_000,
        week: 604800_000,
        month: 2592000_000,
      };
      const cutoff = now - (periodMs[args.period] ?? periodMs.day);
    
      const entries = potLog.filter((e) => e.createdAt >= cutoff);
      const turboCount = entries.filter((e) => e.mode === AdaptiveMode.TURBO).length;
      const fullCount = entries.filter((e) => e.mode === AdaptiveMode.FULL).length;
      const totalSwaps = entries.length;
    
      return serialize({
        period: args.period,
        totalSwaps,
        turboCount,
        fullCount,
        turboRatio: totalSwaps > 0 ? +(turboCount / totalSwaps).toFixed(4) : 0,
        currentMode: adaptiveSwitch.getCurrentMode(),
        windowStart: new Date(cutoff).toISOString(),
        windowEnd: new Date(now).toISOString(),
      });
    }

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/Helm-Protocol/openttt-mcp'

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