Summary
The blocks page (/blocks) displays three stat cards labeled "Blocks 24h", "Rewards 24h", and "Burned 24h". These labels imply a rolling 24-hour window from the current moment, but the data actually represents yesterday's completed calendar day (midnight-to-midnight).
Evidence
1. Frontend calls yesterdayStatisticsCall()
File: src/services/apiCalls.ts
export const yesterdayStatisticsCall = async (): Promise<IBlockStats> => {
const res = await api.get({
route: 'block/statistics-by-day/1',
});
return res.data.block_stats_by_day[0];
};
The function is explicitly named yesterdayStatisticsCall, and it hits block/statistics-by-day/1.
2. API endpoint returns calendar-day buckets
The upstream Klever API endpoint block/statistics-by-day/{N} returns N discrete calendar-day records, each with a date field (Unix timestamp for that day). The {N} parameter is the number of past days to return — not a rolling hour window.
Confirmed by the charts page (src/pages/charts/index.tsx), which calls block/statistics-by-day/15 and formats each record's date as:
date: format(stats.date, 'dd MMM') // e.g., "05 Mar"
This proves each record maps to a specific calendar date, not a sliding time window.
3. UI labels are misleading
File: src/pages/blocks/index.tsx (lines 189-247)
const cards: ICard[] = [
{
title: 'Number of Blocks',
headers: ['Blocks 24h', 'Cumulative Number'], // ← misleading
values: [blocksStatsYesterday?.totalBlocks, ...],
},
{
title: 'Block Reward',
headers: ['Rewards 24h', 'Cumulative Revenue'], // ← misleading
values: [blocksStatsYesterday?.totalBlockRewards, ...],
},
{
title: 'Stats on Burned KLV',
headers: ['Burned 24h', 'Burned in Total'], // ← misleading
values: [blocksStatsYesterday?.totalBurned, ...],
},
];
All three cards use blocksStatsYesterday (from yesterdayStatisticsCall) but label the values as "24h".
4. No rolling 24h endpoint exists
The upstream Klever API only exposes:
block/statistics-by-day/{N} — calendar-day buckets
block/statistics-total/0 — all-time cumulative totals
There is no block/statistics-rolling/24h or time-range-based block statistics endpoint.
Impact
Users see "Blocks 24h" / "Rewards 24h" / "Burned 24h" and expect data from the last 24 hours. Instead, they get yesterday's full-day stats, which can be up to ~48 hours stale (e.g., at 11:59 PM, the data still reflects the day before).
Options
- Fix the label — Rename "24h" → "Yesterday" in the frontend to match the actual data semantics. Quick fix, accurate UX.
- Fix the data — Implement a rolling 24h aggregation (either via a new upstream API endpoint, or a proxy endpoint in
kleverscan-api that fetches recent blocks and aggregates client-side). Correct UX, requires backend work.
- Both — Fix labels now as a quick win, then implement true 24h data as a follow-up.
Affected files
src/pages/blocks/index.tsx — card labels and data binding
src/services/apiCalls.ts — yesterdayStatisticsCall() function
Summary
The blocks page (
/blocks) displays three stat cards labeled "Blocks 24h", "Rewards 24h", and "Burned 24h". These labels imply a rolling 24-hour window from the current moment, but the data actually represents yesterday's completed calendar day (midnight-to-midnight).Evidence
1. Frontend calls
yesterdayStatisticsCall()File:
src/services/apiCalls.tsThe function is explicitly named
yesterdayStatisticsCall, and it hitsblock/statistics-by-day/1.2. API endpoint returns calendar-day buckets
The upstream Klever API endpoint
block/statistics-by-day/{N}returnsNdiscrete calendar-day records, each with adatefield (Unix timestamp for that day). The{N}parameter is the number of past days to return — not a rolling hour window.Confirmed by the charts page (
src/pages/charts/index.tsx), which callsblock/statistics-by-day/15and formats each record's date as:This proves each record maps to a specific calendar date, not a sliding time window.
3. UI labels are misleading
File:
src/pages/blocks/index.tsx(lines 189-247)All three cards use
blocksStatsYesterday(fromyesterdayStatisticsCall) but label the values as "24h".4. No rolling 24h endpoint exists
The upstream Klever API only exposes:
block/statistics-by-day/{N}— calendar-day bucketsblock/statistics-total/0— all-time cumulative totalsThere is no
block/statistics-rolling/24hor time-range-based block statistics endpoint.Impact
Users see "Blocks 24h" / "Rewards 24h" / "Burned 24h" and expect data from the last 24 hours. Instead, they get yesterday's full-day stats, which can be up to ~48 hours stale (e.g., at 11:59 PM, the data still reflects the day before).
Options
kleverscan-apithat fetches recent blocks and aggregates client-side). Correct UX, requires backend work.Affected files
src/pages/blocks/index.tsx— card labels and data bindingsrc/services/apiCalls.ts—yesterdayStatisticsCall()function