fix(rewards): crown logic in perps leaderboard#29887
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag Selection Rationale:
Not Selected:
Performance Test Selection: |
|



Description
Fix wrong number of crowns shown in Perps leaderboard
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Low risk UI logic change that only affects when the crown icon renders; covered by updated/added unit tests for winner thresholds and preview mode.
Overview
Fixes crown rendering so leaderboards only show crowns for actual winner ranks.
CampaignLeaderboardEntryRownow renders a crown strictly based on theshowCrownprop (no internal rank check), andOndoLeaderboard/PerpsTradingCampaignLeaderboardnow computeshowCrownusing new constants (ONDO_GM_TIER_MAX_WINNERS = 5,PERPS_TRADING_MAX_WINNERS = 20) while still disabling crowns in preview mode.Adds/updates tests to assert correct crown behavior for winner thresholds and preview vs full views across the shared row, Ondo, and Perps leaderboards.
Reviewed by Cursor Bugbot for commit 900c4bd. Bugbot is set up for automated code reviews on this repo. Configure here.