getDailyStatsPage (leaderboards.ts)

clawhub · leaderboards, trending-ranks, stats-pagination, rebuild-jobs, analytics, scheduled-tasks

Paginates daily stats for leaderboards; retrieves trend entries with cursor, keyed by date.

// Source: https://github.com/openclaw/clawhub | License: MIT | Copyright 2026 Peter Steinberger
// Provided via justclaw.it.com; keep this notice with the code.
import { v } from "convex/values";
import { internal } from "./_generated/api";
import type { Id } from "./_generated/dataModel";
import { internalAction, internalMutation, internalQuery } from "./functions";
import {
  compareTrendingEntries,
  getTrendingRange,
  takeTopNonSuspiciousTrendingEntries,
  takeTopTrendingEntries,
  TRENDING_LEADERBOARD_KIND,
  TRENDING_NON_SUSPICIOUS_LEADERBOARD_KIND,
} from "./lib/leaderboards";

const MAX_TRENDING_LIMIT = 200;
const KEEP_LEADERBOARD_ENTRIES = 3;
const DAILY_STATS_PAGE_SIZE = 1_000;

// ---------------------------------------------------------------------------
// Action → Query → M

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key