feat(leaderboard): pure verified-earnings board + Club row chips + 5-min cadence (#978)#988
Merged
Merged
Conversation
…min cadence (#978) Phase 4: make /leaderboard a pure earnings board (per request — the trading competition's P&L/Volume/Trades scoreboard is retired from this page). - LeaderboardClient: earnings-only. Columns Rank · Agent (+Club chip) · Earnings (30d) · Payers · Latest; sort chips earnings(default)/payers/latest. Removed the entire client-side Tenero price-fetch + Volume/P&L/Trades compute. - page.tsx: rebuildLeaderboard now reads the new getEarningsBoard (one index-served scan, 30d + lifetime + payers + latest + metadata), dropping the LEADERBOARD_AGGREGATE_SQL swap scan (the code's "largest D1 read surface") and the separate earnings overlay. Header/metadata rewritten for earnings; competition countdown removed. Cache key v2→v3 (earnings-only shape), TTL 5min. - reads.ts: getEarningsBoard (per-agent 30d + lifetime, HAVING lifetime>0). - ClubBadge now also renders per leaderboard row (lifetime earnings). - constants: EARNINGS_INTERVAL_MS → 5min (every cron tick) for fast backfill. Net: far less D1 (no swap scan) + zero client price calls.
… comments Addresses the pre-push /code-review: - BLOCKER: the EARNINGS_INTERVAL_MS doc comment contained "*/5" which closed the JSDoc block early and broke compilation. Switched to // line comments. - Deleted app/leaderboard/CompetitionCountdown.tsx — orphaned after the pure-earnings rewrite (no importers repo-wide). - Refreshed stale page.tsx comments that referenced LEADERBOARD_AGGREGATE_SQL / the per-sender rollup / the removed scheduler kick → now describe getEarningsBoard.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
landing-page | 2c8498e | Commit Preview URL Branch Preview URL |
Jun 08 2026, 10:17 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The leaderboard rewrite that missed #987. #987 was merged at its profile-only state, before this leaderboard work was pushed — so
mainstill serves the old #986 board (Trades / Volume / P&L, "TRADING LEADERBOARD"). This PR makes/leaderboarda pure verified-earnings board.Changes
LeaderboardClient— earnings-only. Columns: Rank · Agent (+ Club chip) · Earnings (30d) · Payers · Latest; sort chips Earnings (default) / Payers / Latest. Removed the entire client-side Tenero price-fetch + Volume/P&L/Trades compute.page.tsx—rebuildLeaderboardnow reads newgetEarningsBoard(one index-served scan: 30d + lifetime + payers + latest + metadata), dropping theLEADERBOARD_AGGREGATE_SQLswap scan (the code's "largest D1 read surface") and the earnings overlay. Header/metadata rewritten for earnings; competition countdown removed. Cache keyv2→v3, TTL 5min.reads.ts—getEarningsBoard(per-agent 30d + lifetime,HAVING lifetime>0).ClubBadgenow renders per leaderboard row (lifetime earnings).constants.ts—EARNINGS_INTERVAL_MS→ 5 min (every cron tick) for fast backfill.CompetitionCountdown.tsx.Net: far less D1 (no swap scan) + zero client price calls.
Review
/code-review(high) ran on this exact changeset. It caught a build blocker — a*/5inside a JSDoc comment closed the block early — now fixed (line comments). Correctness pass otherwise clean (SQL binds/units, cache-key bump, exhaustive sort, null guards).tsc+ lint clean, full suite 1512 passing.Once merged + deployed,
/leaderboardbecomes the pure earnings board. Part of #978.