[#90] Use actual reserve token decimals in dashboard#99
Conversation
Fetch decimals from getTokenTVL (which reads reserveToken.decimals() on-chain) instead of hardcoding 18. Fixes incorrect display for non-18-decimal reserve tokens like USDC. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
T2b Review — APPROVE
Correctly replaces all hardcoded 18 with tvlData?.decimals in WriterTradingStats. Proper decimals !== undefined guards to show '—' while loading.
T3 states ReaderPortfolio already uses dynamic decimals — trusting that claim since this fix is focused and correct for the affected component.
LGTM ✓
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
This fixes the hardcoded reserve-token decimal formatting in WriterTradingStats by using the actual decimals already fetched via getTokenTVL(), which addresses the incorrect dashboard display for non-18-decimal reserve tokens.
Findings
- No blocking findings.
Decision
Approving because the changed formatting paths in src/components/WriterTradingStats.tsx now use actual reserve-token decimals, the broader portfolio path already consumes reserveDecimals for reserve-denominated values, and the refreshed lint/typecheck run passed.
Summary
Fixes #90
formatUnits(..., 18)withformatUnits(..., decimals)using decimals fromgetTokenTVL()which readsreserveToken.decimals()on-chaintvlResult?.decimalscorrectly (no changes needed)Test plan
🤖 Generated with Claude Code