[#355] Fix blank token price on writer dashboard#360
Conversation
Price display depended on decimals from the TVL query (no fallback), so if getTokenTVL was slow or failed, both price and TVL showed "—". Default decimals to 18 (matching ClaimRoyalties and getTokenPrice) so price renders independently of the TVL query. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
LGTM. Sensible fallback — ?? 18 matches the reserve token's actual decimals and aligns with existing patterns in ClaimRoyalties/getTokenPrice. Approved.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The fix addresses the token price rendering fallback, but the issue scope and acceptance criteria cover both blank token price and blank TVL on the writer dashboard. This diff leaves the TVL path unchanged, so the reported bug is only partially fixed.
Findings
- [medium] TVL remains unaddressed in this PR.
- File:
src/components/WriterTradingStats.tsx:52 - Suggestion: either fix the TVL fetch/render failure in this same PR, or narrow the issue/PR scope explicitly if TVL is being handled separately. As submitted, the issue says both values are blank and the component still renders
"—"whenevergetTokenTVL(tokenAddress)does not return data.
- File:
Decision
Requesting changes because the PR does not yet satisfy issue #355 end-to-end. lint-and-typecheck was also still pending at review time, but the main blocker is the incomplete bug fix.
Address T2a review: TVL still showed "—" when getTokenTVL failed independently. Now both values are fetched atomically in one query with retry:2 and refetchInterval:30s. TVL falls back to "0" when getTokenTVL returns null but price succeeds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
LGTM on re-review. Atomic fetch via Promise.all resolves T2a's concern — price and TVL now succeed/fail together, TVL falls back to "0" instead of "—" when getTokenTVL returns null. retry: 2 and refetchInterval add good resilience. Approved.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The updated PR now addresses the end-to-end issue scope in WriterTradingStats by fetching price and TVL together and rendering both from one result shape. This resolves the earlier partial-fix problem while keeping the change narrowly scoped to the affected dashboard component.
Findings
- No remaining correctness or design issues found in the updated diff.
Decision
Approved on re-review. lint-and-typecheck was still pending at the time of approval, so merge should still wait for required GitHub checks.
Summary
WriterTradingStatsdepended ondecimalsfrom the TVL query with no fallback — ifgetTokenTVLwas slow or failed,decimalswasundefined, making the price condition falsedecimalsto 18 (?? 18), matching the pattern inClaimRoyalties.tsxand the hardcoded 18 ingetTokenPrice()Fixes #355
Files changed
src/components/WriterTradingStats.tsx— 2-line fix (decimals fallback + simplified condition)Test plan
next buildpasses🤖 Generated with Claude Code