feat(rewards): add Perps Trading Campaign#29323
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. |
0fda384 to
b602f61
Compare
26d6760 to
9da0251
Compare
f92e83f to
0c6256d
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #29323 +/- ##
========================================
Coverage 81.86% 81.87%
========================================
Files 5255 5270 +15
Lines 138980 139410 +430
Branches 31518 31662 +144
========================================
+ Hits 113774 114136 +362
- Misses 17465 17517 +52
- Partials 7741 7757 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c967e29 to
e8deae4
Compare
557d8c0 to
473eb2e
Compare
e795ae6 to
ceca14a
Compare
| isLoading: isLeaderboardLoading, | ||
| hasError: hasLeaderboardError, | ||
| isLeaderboardNotYetComputed, | ||
| computedAt: leaderboardComputedAt, |
There was a problem hiding this comment.
Duplicate destructuring creates unused leaderboardComputedAt variable
Medium Severity
The property computedAt is destructured twice from useGetOndoLeaderboard — once as computedAt (line 121) and again as leaderboardComputedAt (line 125). The leaderboardComputedAt variable is never referenced anywhere in the file. This looks like an accidental leftover from development, likely intended to be passed to LeaderboardPositionHeader (which added computedAt to its interface but never wired it up).
Reviewed by Cursor Bugbot for commit ceca14a. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b3ac5a6. Configure here.
Full mobile implementation of the Perps Trading Competition campaign: data layer (new DTOs, RewardsController cached methods, RewardsDataService API calls, messenger actions), Redux state + selectors, three hooks (leaderboard, leaderboard position, prize pool), components (PerpsTradingCampaignLeaderboard, PerpsTradingCampaignPrizePool, PerpsTradingCampaignCTA with perps geo-restriction, PerpsTradingCampaignStatsHeader), three campaign views (details, leaderboard, stats), navigator registration, route constants, CampaignTile routing, tour step view routing, and en.json translations. Tests added for all three hooks and the formatPnl utility. Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> f Fix perp details view Fix stats page Fix leaderboard Fix tests Fix lint Update RewardsController-method-action-types.ts Fix Fix Ondo computedAt Fix prize pool Fix prize pool Add qualified card Fix test Update endpoint Update useGetPerpsTradingCampaignVolume.test.ts Fix lint
637c0d9 to
cb11d59
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag Selection Rationale:
The changes are primarily additive (new feature, not modifying existing flows), which reduces risk. No existing E2E tests directly test the Rewards/Perps Campaign leaderboard feature, so the main risk is regression in existing Perps and WalletPlatform flows due to the controller state changes and navigation updates. Performance Test Selection: |
|




Description
https://consensyssoftware.atlassian.net/browse/RWDS-1239
https://consensyssoftware.atlassian.net/browse/RWDS-1190
https://consensyssoftware.atlassian.net/browse/RWDS-1215
Adds support for the Perps Trading Competition rewards campaign. Users can view campaign details, join via a guided tour, track their stats (rank, PnL, notional volume and margin thresholds), browse the leaderboard, and monitor the prize pool — which scales from $10k to $50k based on total notional volume. Geo-restricted users see a locked CTA. Once opted in, the CTA switches to "Open Position" navigating directly to the Perps tab.
New screens: campaign details, stats, and full leaderboard. All data-driven from the existing campaign/leaderboard backend infrastructure.
Changelog
CHANGELOG entry: Added: Rewards Perps Trading Campaign — details page, stats page, leaderboard page, prize pool, tour, and opt-in flow.
Screenshots
----------------------------------------Qualified----------------------------------------
----------------------------------------Pending----------------------------------------
----------------------------------------Split View----------------------------------------
---------------------------------Powered by HyperTracker------------------------------
Note
Medium Risk
Adds new Rewards navigation routes and multiple Perps campaign views/CTAs, plus refactors shared leaderboard/prize-pool logic that could affect existing Ondo rendering and testIDs. Risk is moderate due to new conditional UI flows and reused components across campaigns.
Overview
Adds a new Perps Trading rewards campaign user flow with dedicated
details,leaderboard, andstatsscreens, wiring them intoRewardsNavigator,CampaignTilenavigation (including tour routing), and deeplink handling (campaign=perps-comp).Refactors campaign UI to improve reuse: extracts a shared
CampaignLeaderboard(rows/skeleton/separator + shared test IDs) and updatesOndoLeaderboardto use it; splitsCampaignStatsSummaryintoOndoCampaignStatsSummary(renamed test IDs) and reuses itsStatCell/tags in new Perps stats components.Unifies prize pool tier computation by introducing
computePrizePoolProgressand migratingOndoPrizePool/OndoLeaderboardViewoff bespokegetCurrentPrize/progress logic. Adds extensive test coverage for the new Perps views/components and updated Ondo stats/leaderboard behavior.Reviewed by Cursor Bugbot for commit fcf01e2. Bugbot is set up for automated code reviews on this repo. Configure here.