Skip to content

feat: add total reward info#5678

Merged
cuzz-venus merged 5 commits into
mainfrom
feat/prime-rewards
Jul 13, 2026
Merged

feat: add total reward info#5678
cuzz-venus merged 5 commits into
mainfrom
feat/prime-rewards

Conversation

@cuzz-venus

@cuzz-venus cuzz-venus commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Jira ticket(s)

VPD-1544

Changes

  • add total reward in total reward card

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview Jul 10, 2026 7:04am
dapp-testnet Ready Ready Preview Jul 10, 2026 7:04am
venus.io Ready Ready Preview Jul 10, 2026 7:04am

Request Review

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e0698ea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@venusprotocol/evm Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Jul 8, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds total estimated Prime reward information to the leaderboard card. The main changes are:

  • Adds estimated total reward fields to the Prime current-cycle API mapping.
  • Passes the estimated total through the Prime rewards hook and section component.
  • Renders a localized total-pool label in the total rewards card.
  • Updates mocks, tests, translations, and the changeset.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/evm/src/clients/api/queries/getPrimeCurrentCycle/index.ts Adds estimated total reward fields to the Prime current-cycle response shape and mapping.
apps/evm/src/pages/PrimeLeaderboard/useGetPrimeTotalRewards/index.ts Converts the estimated total reward mantissa into cents for the leaderboard UI.
apps/evm/src/pages/PrimeLeaderboard/TotalRewardsCard/index.tsx Displays the estimated total reward label alongside distributed Prime rewards.
apps/evm/src/pages/PrimeLeaderboard/TotalRewardsSection/index.tsx Passes the estimated total reward value from the hook to the card.
apps/evm/src/libs/translations/translations/en.json Adds the English text for the new total-pool reward label.

Reviews (2): Last reviewed commit: "feat: update name" | Re-trigger Greptile

Comment on lines +45 to +47
totalPoolCents: pendingPool
? convertUsdMantissaToCents(pendingPool.currentEstimatedTotalUsdMantissa).toNumber()
: 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing API Field Becomes NaN

When /prime/cycle/current returns a pending pool without the newly added currentEstimatedTotalUsdMantissa field, this conversion receives undefined and produces NaN. The card then treats NaN as falsy and silently hides the total-pool line, so a backend/frontend rollout mismatch makes the new reward total disappear instead of showing a safe fallback or a clear API error.

Suggested change
totalPoolCents: pendingPool
? convertUsdMantissaToCents(pendingPool.currentEstimatedTotalUsdMantissa).toNumber()
: 0,
totalPoolCents: pendingPool
? convertUsdMantissaToCents(pendingPool.currentEstimatedTotalUsdMantissa ?? '0').toNumber()
: 0,

Context Used: Ensure the rules defined in the files under .claud... (source)

Comment on lines +57 to +66

{!!totalPoolCents && (
<p className="text-b2r text-light-grey">
<Trans
i18nKey="primeLeaderboard.totalRewards.totalPoolLabel"
components={{ Highlight: <span className="text-white" /> }}
values={{ amount: formatCentsToReadableValue({ value: totalPoolCents }) }}
/>
</p>
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Zero Total Pool Is Hidden

When the API returns an active pending pool with currentEstimatedTotalUsdMantissa: "0", totalPoolCents is 0 and this truthiness gate suppresses the new denominator text. The card still shows distributed rewards, but users do not see the $0 total rewards context that this change adds.

Context Used: AGENTS.md (source)

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 82.31% 50243 / 61041
🔵 Statements 82.31% 50243 / 61041
🔵 Functions 62.08% 673 / 1084
🔵 Branches 73% 5708 / 7819
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/clients/api/queries/getPrimeCurrentCycle/index.ts 100% 100% 100% 100%
apps/evm/src/pages/PrimeLeaderboard/TotalRewardsCard/index.tsx 100% 75% 100% 100%
apps/evm/src/pages/PrimeLeaderboard/TotalRewardsSection/index.tsx 100% 0% 100% 100%
apps/evm/src/pages/PrimeLeaderboard/useGetPrimeTotalRewards/index.ts 97.22% 81.81% 100% 97.22% 1
Generated in workflow #13797 for commit e0698ea by the Vitest Coverage Report Action

Comment thread apps/evm/src/pages/PrimeLeaderboard/useGetPrimeTotalRewards/index.ts Outdated
Comment thread apps/evm/src/pages/PrimeLeaderboard/TotalRewardsCard/index.tsx Outdated
@cuzz-venus

Copy link
Copy Markdown
Contributor Author

@greptile review again

@cuzz-venus cuzz-venus merged commit 84d48f7 into main Jul 13, 2026
5 checks passed
@cuzz-venus cuzz-venus deleted the feat/prime-rewards branch July 13, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants