Skip to content

chore(rewards): perps campaign remove margin stat#29911

Merged
VGR-GIT merged 1 commit into
mainfrom
rwds-perps-campaign-remove-margin-stat
May 8, 2026
Merged

chore(rewards): perps campaign remove margin stat#29911
VGR-GIT merged 1 commit into
mainfrom
rwds-perps-campaign-remove-margin-stat

Conversation

@VGR-GIT

@VGR-GIT VGR-GIT commented May 8, 2026

Copy link
Copy Markdown
Contributor

Description

Removes the margin requirement from the Perps Trading Campaign rewards qualification UI to match the latest design. Qualification is now driven solely by notional volume (≥ $25k); the marginDeployed field is dropped from DTOs, cached state, controller cache read/write, locale keys, and tests. On the stats screen PnL and Volume now share one row, and the summary card replaces the margin StatCell with a spacer so Volume stays left-aligned.

Changelog

CHANGELOG entry: null

Screenshots/Recordings

  • Active campaign, have positions
image image
  • Completed campaign, have positions
image

Note

Medium Risk
Medium risk because it removes the marginDeployed field from Perps leaderboard position DTO/state and updates controller caching logic, which could break consumers expecting that data or older cached shapes.

Overview
Updates the Perps Trading Campaign flow to drop the margin-deployed metric and requirement, making qualification driven solely by notional volume.

This removes marginDeployed from the Perps leaderboard position DTO and cached state, updates RewardsController cache read/write accordingly, and simplifies the stats/summary UI to no longer render a margin StatCell (using a spacer to preserve layout). Tests and locale strings are updated to match the new three-stat display and revised qualification semantics.

Reviewed by Cursor Bugbot for commit 855c01b. Bugbot is set up for automated code reviews on this repo. Configure here.

@VGR-GIT VGR-GIT requested a review from a team as a code owner May 8, 2026 11:42
@metamaskbotv2 metamaskbotv2 Bot added the team-rewards Rewards team label May 8, 2026
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

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.

@metamaskbotv2 metamaskbotv2 Bot added the INVALID-PR-TEMPLATE PR's body doesn't match template label May 8, 2026
@github-actions github-actions Bot added the size-S label May 8, 2026
@VGR-GIT VGR-GIT enabled auto-merge May 8, 2026 12:50
Co-authored-by: VGR-GIT <vangulckrik@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
@sophieqgu sophieqgu force-pushed the rwds-perps-campaign-remove-margin-stat branch from 965c9a2 to 855c01b Compare May 8, 2026 16:20
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR removes the marginDeployed field from the Perps Trading Campaign feature across multiple layers:

  1. RewardsController.ts (critical): Removes marginDeployed from the leaderboard position cache read/write paths. This is a narrow, focused change to a critical controller - only 2 lines removed.

  2. types.ts (critical): Removes marginDeployed from PerpsTradingCampaignLeaderboardPositionDto and PerpsTradingCampaignLeaderboardPositionFoundState. Also updates the qualified field comment to reflect that only notional volume ≥ $25k is required (margin requirement removed).

  3. UI Components: PerpsTradingCampaignStatsView.tsx and PerpsCampaignStatsSummary.tsx both remove the "Margin" stat cell from their respective UIs, restructuring the layout.

  4. Localization: All 15 language files remove label_margin and label_margin_deployed keys.

  5. Unit tests: Updated to reflect the removal.

Tag Selection Rationale:

  • SmokePerps: Directly tests Perps functionality including the Add Funds flow and Perps interface. The campaign stats view changes (removing margin display) are part of the Perps UI that these tests exercise. The RewardsController changes affect the data layer for Perps campaigns.
  • SmokeWalletPlatform: Per the tag description, Perps is a section inside the Trending tab, and changes to Perps views (headers, lists, full views) affect this tag. The PerpsTradingCampaignStatsView and PerpsCampaignStatsSummary are Perps views embedded in Trending.

No E2E tests directly test marginDeployed or the campaign stats view specifically - these are covered by unit tests. The changes are backward-compatible removals that simplify the UI. The RewardsController change is narrow and doesn't affect core authentication, opt-in, or subscription flows.

Performance Test Selection:
The changes remove a single field (marginDeployed) from the Perps campaign leaderboard position data and its UI display. This is a data model simplification with no impact on rendering performance, list rendering, data loading patterns, or critical user flows. No performance-sensitive code paths are affected.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 8, 2026

Copy link
Copy Markdown

@VGR-GIT VGR-GIT added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit 90322ac May 8, 2026
92 of 94 checks passed
@VGR-GIT VGR-GIT deleted the rwds-perps-campaign-remove-margin-stat branch May 8, 2026 17:38
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-S team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants