ux: Charts/Protocol 24h volume looks cumulative — disclose trailing window (not midnight reset) #576
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#576
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Retail on Charts & Analytics (
/chartsat dex.cl8y.com) reads 24h Volume (USD) as a calendar-day counter that should hit$0(e.g. at midnight). It does not. The indexer figure is a trailing 24-hour window (Utc::now() − 24hoverswap_events). With ongoing mainnet activity the number is expected to stay above$0and can trend up for days. The UI never says that.This issue owns copy + progressive disclosure on Charts, Protocol, pair 24h stats, and related 24h volume labels so the existing rolling math is obvious. It does not change the window to UTC calendar days.
Related (do not treat as done here): #548 USD-only overview; #550 Protocol 24h/7d/30d; #565 pair Vol (USD); #243 / #333 rollups. Indexer rollups that fail to decay (token stats, idle traders, stale
global_stats_24hif the aggregator dies) are a separate linked issue.Current codebase
What
/chartsactually showsChartsPage.tsxloadsGET /api/v1/overviewand renders:total_volume_24h_usd24h Volume (USD);title="24h volume in USD"total_trades_24hGET /api/v1/pairs/{addr}/statsvolume_usdtitle="24h volume in USD"high_usd/low_usdStatBoxputstitleon the card (<div title={title}>). Native hover only; noaria-describedby. Mobile (the screenshot surface) has no hover, so the tooltip never appears on phones.Pair list SORT default is
24h volume(PAIR_SORT_OPTIONS)./poolcolumn header is Vol sorted asvolume_24h(PoolPairsTable.tsx) — no window text./protocollabels24h volume,7d volume,30d volumewith a lead that explains USD/oracle provenance, not trailing vs calendar. Notitleon thoseStatBoxes.Indexer window (correct for this issue)
refresh_global_stats/get_global_stats_live:Utc::now() - Duration::hours(24)(and 7d / 30d).SUM(volume_usd) FILTER (WHERE block_timestamp >= cutoff).global_stats_24h, refresh ~5 min (volume_aggregator.rs),/overviewcached 60s (overview.rs).get_24h_stats_for_pairuses the samenow − 24hlive filter.global_stats_rollup_excludes_swaps_older_than_24h). Idle DEX with zero 24h trades is allowed to show$0(#548 C3).There is no UTC midnight reset. A growing DEX with continuous swaps will not print
$0on Charts. That is intended.Docs / glossary gap
docs/frontend.md§ Charts overview documents USD formatting, not trailing vs calendar.docs/indexer-invariants.mdsays “Overview global 24h stats” / rollup lag, not retail wording.docs/design-system.mdterminology glossary has no 24h volume row.docs/user-incident-faq.mdis incident controls only — wrong place for this FAQ.Why this is needed
24h volume in USD).pair_volume_24h, and every existing test cutoff.Constraints / guardrails
now − 24h(and 7d / 30d). No UTC-day, no “resets at 00:00”, no cron that zeros the rollup./chartsor/protocol. Progressive disclosure = nativetitle/aria-label(and optional one-line glossary in docs). Do not paste indexer SQL into the UI.total_volume_24h. Charts stays USD-only (#548 C1). Idle →$0; unpriced + trades →—.VITE_INDEXER_URLor hostnames in titles (#215).title(XSS / layout).titleis not enough. Prefer a visible short label change or anaria-labelon the value that screen readers and (if needed) a tap-safetitleon the label text. Do not add a permanent help paragraph.volume_usdformula; rollup SQL decay (linked indexer issue); CG/CMC; trader lifetime Volume (USD) (#553); candle histogram.Relevant files
frontend-dapp/src/pages/ChartsPage.tsxfrontend-dapp/src/pages/ChartsPage.test.tsxfrontend-dapp/src/components/ui/StatBox.tsxfrontend-dapp/src/components/protocol/ProtocolGlobalStats.tsx,frontend-dapp/src/pages/ProtocolPage.test.tsxfrontend-dapp/src/components/pool/PoolPairsTable.tsxfrontend-dapp/src/utils/chartsOverviewStats.tsdocs/frontend.md(§ Charts overview, Protocol),docs/design-system.md(glossary),skills/AGENTS_FRONTEND_CHARTS_OVERVIEW.md,skills/AGENTS_FRONTEND_PROTOCOL_STATS.md,skills/AGENTS_FRONTEND_COPY_COGNITIVE_LOAD.mdindexer/src/db/queries/volume.rs,indexer/src/api/overview.rsRecommended direction
titleon Vol): e.g. label stays24h Volume (USD)(orLast 24h Vol (USD)if it still fits #489);title/aria-label= one sentence: “Priced swaps in the last 24 hours, not a midnight reset.” Protocol 7d/30d: same pattern (“last 7 days” / “last 30 days”).titleon the label<p>(or a visibleabbr) so mobile long-press / accessibility can reach it; keepdata-testids (charts-overview-volume-usd,protocol-stat-volume-24h,charts-pair-volume-usd).docs/design-system.md: 24h volume = trailing window. frontend.md + skills: one sentence that$0is idle-window, not daily close.title/aria-labelon overview, pair stats, Protocol. Do not assert a$0after wall-clock midnight.make verify-issue-<iid>listed in Makefile help.Acceptance criteria
aria-labelthat works without hover.total_volume_24h.$0; unpriced + trades still—; USD compact format unchanged (C1–C3).make verify-issue-<iid>exists.Test plan (all paths)
$+ compacttotal_trades_24h === 0, USD"0")$0still allowed; copy does not promise a daily resetusdnull, trades > 0)—; copy unchangedtitle; sort stillvolume_24h; no catalog-rank regression24h volume/chartsTest plan (attack, hack, abuse)
<script>/ overlongtotal_volume_24h_usdin tooltipformatChartsOverviewVolumeUsd(#548 A4)http,VITE_, hostnamesVerification criteria
make verify-issue-<iid>(Vitest Charts + Protocol + StatBox; optional Playwright/chartsmocked overview)./chartsand/protocolon a phone-width viewport — a new user can tell volume is last 24 hours, not “since launch” and not “since midnight”.$0; with a fixture of zero 24h swaps, volume is$0.GET /api/v1/overviewfield semantics in this issue.marked as related to #577
mentioned in merge request !1096
mentioned in merge request !1099
mentioned in commit
f6b79a17d8mentioned in commit
39c6cb382amentioned in commit
2db2d42baaMerged via !1096.
make verify-issue-576passed after resolving Makefile conflicts withorigin/main(keptverify-issue-573). Remaining unchecked items are production/visual, not code:/chartsand/protocol: confirm a new user can tell volume is last 24 hours (visible Last 24h + aria-label), not since launch / midnightIndexer rollup decay is #577 (!1099), not this issue.
mentioned in issue #569
mentioned in issue #583
marked as related to #583
mentioned in issue #586
mentioned in issue #589
mentioned in issue #597
mentioned in issue #652
mentioned in issue #653
mentioned in issue #655
mentioned in issue #666
marked as related to #666
mentioned in issue #667
mentioned in issue #668
mentioned in merge request !1163
mentioned in merge request !1164
mentioned in issue #677
mentioned in issue #689
marked as related to #689
mentioned in issue #692
marked as related to #692
mentioned in issue #703