feat: display 5 year projected balance on money account deposit page#29607
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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 3bd747c. Configure here.
|
|
||
| const growthFactor = new BigNumber(1).plus( | ||
| new BigNumber(apy).dividedBy(100), | ||
| ); |
There was a problem hiding this comment.
APY treated as percentage but API returns decimal
High Severity
vaultApyQuery.data?.apy returns a decimal (e.g., 0.05 for 5%), as confirmed by every other consumer in the codebase and the hook's own apyPercent = rawApy * 100 conversion. The component divides this decimal by 100 again via dividedBy(100), producing a growth factor of ~1.0005 instead of ~1.05. The projected balance will display virtually no growth in production. The tests pass only because they incorrectly mock apy as 5 (percentage) instead of the real 0.05 (decimal).
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3bd747c. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
Other tags (SmokeStake, SmokeSwap, SmokePerps) are not affected as the change is specifically gated to money account deposit transaction type. Performance Test Selection: |
|





Description
Show 5 year projected balane on money account deposit page.
Changelog
CHANGELOG entry:
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1296
Manual testing steps
Screenshots/Recordings
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-only change that adds a derived display value based on APY; main risk is incorrect math/formatting or missing APY data causing the line to disappear.
Overview
Shows a projected 5-year balance line on the custom amount confirmation when the transaction type is
moneyAccountDeposit, replacing the usualPayTokenAmountdisplay in that case.Adds a new
ProjectedFiveYearBalancecomponent that pulls vault APY viauseMoneyAccountBalance, computes 5-year compounding withBigNumber, formats viauseFiatFormatter, and safely returnsnullfor loading/invalid inputs; includes unit tests and a new i18n stringconfirm.custom_amount.projected_five_year_balance.Reviewed by Cursor Bugbot for commit 8c256e1. Bugbot is set up for automated code reviews on this repo. Configure here.