AUDIT page: platform usage stats card (wallets, buys, WarBow CL8Y) #231
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#231
Loading…
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?
Context
The TimeCurve AUDIT surface (
/timecurve/protocol, subnav AUDIT,TimeCurveProtocolPage) is the operator-facing protocol view. It already shows semilive onchain sale reads, indexer-backed Live buys, WarBow governance helpers, and a collapsed raw accordion — but there is no network-wide usage summary for how participants are using the sale + WarBow product.Product ask: add a Platform usage stats card/section on this page covering wallet participation, buy distribution, per-wallet spend, and WarBow action volume with CL8Y spend breakdown.
Related (separate scope): GitLab #229 — DOUB projection economics card on the same page.
Metrics (acceptance)
Participation & buys
0xaddresses that have interacted with TimeCurve sale + WarBow on the indexed chain (see union below).COUNT(*)fromidx_timecurve_buy(canonicalBuyrows).total_buys / unique_buyers(buyers = distinctbuyerinidx_timecurve_buy).percentile_cont(0.5)).SUM(amount)wei). Sort default: spend desc, then buys desc. Paginated (operator-scale; avoid unbounded DOM).Unique-wallet union (recommended v1): distinct addresses appearing in any of:
idx_timecurve_buy.buyeridx_timecurve_warbow_steal.attackeror.victimidx_timecurve_warbow_revenge.avengeror.stealeridx_timecurve_warbow_guard.playeridx_timecurve_warbow_flag_claimed.playerOut of scope unless product expands: Rabbit Treasury deposits/withdrawals, referral
registerCodeburn-only wallets with zero buys/WarBow.WarBow actions & CL8Y
idx_timecurve_warbow_stealSUM(burn_paid_wad).bypassed_victim_daily_limit = true; CL8Y =SUM(burn_paid_wad)for those rows only.idx_timecurve_warbow_revengeSUM(burn_paid_wad).idx_timecurve_warbow_guardSUM(burn_paid_wad).Display each action type as count + total CL8Y (18-decimal formatting via existing
AmountDisplay/ compact helpers). Optional secondary row: mean CL8Y per action if it fits the grid without clutter.Historical
WarBowCl8yBurnedrows (idx_timecurve_warbow_cl8y_burned): pre–FeeRouter era only; do not double-count withburn_paid_wadon action tables for totals (either exclude from v1 totals or document as legacy appendix — recommend exclude for v1; action tables are authoritative post-routing change).Current codebase (research)
TimeCurveProtocolPage.tsxGET /v1/timecurve/buyer-statsinindexer/src/api.rsindexed_buy_count+indexed_charm_weightfor one buyer — not network aggregates.idx_timecurve_buy(amount= CL8Y wei,charm_wad), WarBow migrations20260403150000_timecurve_warbow_actions.up.sqlINV-INDEXER-112).StatCard,#200empty statesEmptyDataPlaceholder/statFromContractReadwhen indexer offline.totalfor wallet table.Gap: No
GET /v1/timecurve/platform-usage(name TBD) returning summary + paginated wallet rows. Frontend must not scrape all buys client-side.Recommended solution
1. Indexer API (new)
Add
GET /v1/timecurve/platform-usage(or/usage-stats) with:Query:
offset,limit(wallet table page; clamp like other list routes).Response (sketch):
GROUP BY buyerfor wallet aggregates; WarBow counts via separate aggregates or CTEs.column = $nwith lowercase bind (INV-INDEXER-149-ADDR-EQ,INV-INDEXER-165).SCHEMA_VERSION+ document inindexer/README.md/docs/indexer/design.md.indexer/tests/integration_stage2.rswith seeded buys + WarBow rows.2. Frontend
fetchTimecurvePlatformUsageinindexerApi.ts.TimeCurveProtocolPlatformUsageSection.tsx:PageSectiontitle “Platform usage”, badge indexer-backed.stats-grid: unique wallets, total buys, mean/median buys per wallet, WarBow quadrants (count + CL8Y).AddressInline, explorer links (#98), pagination controls.VITE_INDEXER_URLunset or connectivity offline (#96): muted status + placeholders — no fake zeros.data-testid="timecurve-protocol-platform-usage"for E2E.3. Performance / ops
GROUP BYmay grow large on mainnet; require server-side pagination (default limit 50).?min_buys=1later; v1 returns all buyers with ≥1 buy.Verification criteria
Automated
indexerApi.test.tspatterns).Manual QA
/timecurve/protocolshows Platform usage without expanding raw accordion.Docs (light)
docs/frontend/timecurve-views.mdAUDIT section.INV-INDEXER-*/INV-FRONTEND-*rows in invariants map.Dependencies / decisions
Follow-up (MUSt be added to scope)
Add time-windowed buy velocity stats with a selector:
buy_count_in_window / window_hours(for “last hour”, window is 1h; for “last day”, divide 24h buy count by 24).Indexer: filter
idx_timecurve_buybyblock_timestamp(or indexed block time) ≥now - window. Expose on the same platform-usage route as optional query params, e.g.?velocity_window=1h|24h, or a small nestedvelocityobject in the response.UI: secondary row or sub-grid under Platform usage; refresh with the rest of the section; show empty/“no buys in window” when count is 0.
INCLUDED in v1 of #231 — ship summary + wallet table + WarBow totals + this on the same AUDIT card.
mentioned in commit
2535dbaaaeImplementation summary
Shipped Platform usage on
/timecurve/protocol(GitLab #231):Indexer (schema 1.26.0)
GET /v1/timecurve/platform-usagewith participation summary, WarBow CL8Y quadrants (steals / steal overrides / revenges / guards), buy velocity (velocity_window=1h|24h), and paginated wallet table (default limit 50, sort by CL8Y spent).postgres_gitlab231_platform_usage_summary_wallet_warbow_velocity.Frontend
TimeCurveProtocolPlatformUsageSectionafter Live buys (data-testid="timecurve-protocol-platform-usage").Docs
INV-INDEXER-231-PLATFORM-USAGE,INV-FRONTEND-231-PLATFORM-USAGEskills/README.mdMerged to
main(2535dba).Verification checklist
/timecurve/protocol— Platform usage visible without expanding raw accordioncurl "$INDEXER/v1/timecurve/platform-usage?limit=5&velocity_window=1h"returns expected JSON keys@nullvector_ux — please verify on staging or local full stack when convenient. Leaving this issue open until sign-off.
mentioned in commit
3f44a8d762Follow-up UI polish (merged
3f44a8d)@nullvector_ux — please re-check the AUDIT Platform usage table when you have a moment.
Quick verify
mentioned in issue #233
marked as related to #233
mentioned in issue #234
marked as related to #234
mentioned in issue #235
Verification checklist @PlasticDigits
/timecurve/protocol— Platform usage visible without expanding raw accordioncurl "$INDEXER/v1/timecurve/platform-usage?limit=5&velocity_window=1h"returns expected JSON keysQuick verify
mentioned in commit
81e600b3e7mentioned in issue #262
mentioned in issue #309
mentioned in issue #319