Referrals page: design review — leaderboards, wallet codes, CHARM earnings + CL8Y/USDM/ETH #94
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#94
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?
Summary
Request a product + UX design pass for
/referralsbeyond the current register / share-link surface (docs/product/referrals.md, verification GitLab #64, launch F-11 GitLab #91).Goals
Referral leaderboards
Connected wallet(s) — referral codes
ReferralRegistry), or explicit \u201cnot registered\u201d state + CTA.yieldomega.myrefcode.v1.<wallet>vs authoritative reads.CHARM the connected user has earned (referral program)
refEach,charmWeighteffects).ICharmPrice/ sale context — spell out in design).Deliverables
Acceptance (for implementation follow-up)
docs/testing/invariants-and-business-logic.md— referrals) once UI ships.Labels
Please add appropriate labels (e.g.
frontend,design,product,TimeCurve) if they exist in the project./cc @PlasticDigits/yieldomega
mentioned in commit
2f10a49e4cImplementation landed on
main(GitLab #94)Summary: Referrals page now ships indexer-backed referrer leaderboard, per-wallet indexed CHARM summary (referrer vs referee splits from
ReferralApplied), connected-wallet registration panel, and illustrative CL8Y / USDM / ETH notionals usingcurrentPricePerCharmWad+ the same static fallback multipliers as other pay-mode labels. Bot swarm registers a shared code from Anvil HD index 27 (defaultswarmyo) and setsYIELDOMEGA_REFERRAL_CODEso buys hitbuy(charmWad, codeHash, false)whenYIELDOMEGA_SWARM_REFERRALSis not0.Docs / cross-links:
docs/product/referrals.md(dashboard §),docs/testing/invariants-and-business-logic.md(#94 anchor),docs/indexer/design.md,skills/README.md,skills/verify-yo-referrals-surface/SKILL.md,.cursor/skills/yieldomega-guardrails/SKILL.mditem 15.@brouie — please verify on a stack with indexer + referral buys.
Checklist for verification
GET /v1/referrals/referrer-leaderboard?limit=20returns ranked rows; sums match PostgresSUM(referrer_amount)per referrer.GET /v1/referrals/wallet-charm-summary?wallet=0x…returns string wei totals; referrer vs referee counts match row filters./referralsshows hero + cutouts + Connected wallet / Referral program CHARM / Referrer leaderboard sections; leaderboard empty state when indexer off is readable.VITE_INDEXER_URLpoints at a live indexer; CL8Y line appears whencurrentPricePerCharmWadreads succeed.bash scripts/start-local-anvil-stack.shwithSKIP_ANVIL_RICH_STATE=1(swarm on): swarm logs show referral registration; indexer eventually listsReferralAppliedrows; leaderboard populates.YIELDOMEGA_SWARM_REFERRALS=0skips registrar funding +YIELDOMEGA_REFERRAL_CODEinjection (bots buy without code).Issue left open per request.
mentioned in commit
7b7210f214mentioned in issue #100
Verified #94 referrals leaderboard + earnings on
dd1c59aHEAD today. Items 1-5 PASS, Item 6 deferred. Closing as primary surface verified.Stack state
Boot via:
SKIP_ANVIL_RICH_STATE=1 START_BOT_SWARM=1 bash scripts/start-local-anvil-stack.sh(default referrals on, indexer schema v1.9.0 with new/v1/referrals/*Rust routes).Item 1 —
/v1/referrals/referrer-leaderboardranked rows: PASSEndpoint returns ranked rows with string wei totals.
Top referrer:
0x87bdce72c06c21cd96219bd8521bdf1f42c78b5e(HD-27 /swarmyoregistrar)referred_buy_count: 21 → 40 over sessiontotal_referrer_charm_wad: 4611011563700613660 (≈4.61 CHARM)Cross-check: address matches the
swarm referrals: registered 'swarmyo' for 0x87BdCE72...log line, andreferred_buy_countadvances with each indexer cycle.Item 2 —
/v1/referrals/wallet-charm-summary?wallet=0x...: PASSEndpoint returns string wei totals matching leaderboard:
{ wallet, referrer_charm_wad: "4611011563700613660", referee_charm_wad: "0", referred_buy_count: "21", referee_buy_count: "0" }Referrer counts match leaderboard row exactly.
Item 3 —
/referralspage sections render: PASSHero + cutouts + Connected wallet + Referral program CHARM (indexed) + Referrer leaderboard sections all render. Three-step "Claim a code / Share a live route / Track CHARM" walk-through shown above the dashboard.
Item 4 — Connected wallet earnings panel: PASS
With deployer 0xf39Fd6...2266 connected on Chain 31337, the earnings panel loads cleanly (zero state — wallet hasn't been a referrer/referee). On-chain reward parameters render below ("Per-side referral bonus: 5.00% of charmWad to buyer + same to referrer"). Burn-per-registration figure renders from on-chain read.
Item 5 — Swarm registers + indexer ingests ReferralApplied: PASS
Stack log evidence:
registerCode('swarmyo') tx=8878ad5ea027467390c6645d9dbd2dfed9fff47e1a4a6fa3d90b830cf20596b5 status=1swarm referrals: registered 'swarmyo' for 0x87BdCE72c06C21cd96219BD8521bDF1F42C78b5eIndexer subsequently lists 21 → 40 ReferralApplied rows on the leaderboard. Empty-state copy verified by SIGSTOP indexer mid-session — page shows "Loading referral totals…" and "Loading leaderboard…" gracefully without errors, "Indexer: connecting…" pill appears, on-chain sections (Active address, Reward parameters, Canonical fee sinks) stay live (correct — not indexer-dependent). Recovery on SIGCONT clean.
Item 6 —
YIELDOMEGA_SWARM_REFERRALS=0skip path: DEFERREDTried to exercise this in-session but hit a swarm runner config issue when invoking
swarm_runner.run_swarm()directly outside the start-local-anvil-stack.sh wrapper. The standalone path needs additional env scaffolding the wrapper script provides. Will follow up by setting the env on the wrapper script itself in a separate boot.Closure
Indexer-backed leaderboard + per-wallet summary + frontend page + connected-wallet panel + swarm registration round-trip all verified end-to-end on a 40+ ReferralApplied row dataset. Closing.
cc @PlasticDigits
mentioned in issue #102
marked this issue as related to #102
mentioned in issue #165
mentioned in issue #204
mentioned in issue #225