Replace landing TVL badge with lifetime earnings odometer#1305
Draft
murderteeth wants to merge 2 commits into
Draft
Replace landing TVL badge with lifetime earnings odometer#1305murderteeth wants to merge 2 commits into
murderteeth wants to merge 2 commits into
Conversation
Swap the hero's static TVL pill for a live-ticking lifetime earnings figure ported from the yearn-earn app, rendered with @number-flow/react. - Add src/server/earnings/headline.ts: reads the compute bot's lifetime_yield:headline snapshot from Upstash Redis (REST client, UPSTASH_REDIS_REST_URL_EARNINGS with fallback to unsuffixed vars) and extrapolates it to now using the published rate - Read the headline at ISR revalidation time in app/page.tsx and pass it down as a prop; no API endpoint — the 30d-averaged rate makes the figure tolerant of the page's 6h revalidate window by design, and the client keeps extrapolating locally between page loads - Add LifetimeEarningsStat: seeds from the server value and keeps the figure moving client-side, rolling digits at the whole-dollar cadence - Remove TvlStat, YEARN_TVL_ENDPOINT, and the landing page's dehydrated query state, which only existed to seed the TVL figure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Normalize lander copy to sentence case, keeping proper nouns (Yearn, DeFi, Curve, YFI) and the "Yearn Vaults" product name capitalized. - Hero: "Earn on your crypto" / "Yearn is DeFi's yield aggregator", with mobile now using the same description as desktop - Security: "Security first", "Bug bounties", "Learn more", "Yearn contracts are audited..." - Vaults: "Compounding vaults", "App ecosystem", "View all", "LP token vaults", "Permissionless Curve autocompounders" - Standardize lowercase "Yearn vaults" to "Yearn Vaults" in the Integrations and Vaults sections - FAQs: "Are there developer docs?" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Swaps the hero's static TVL pill for a live-ticking "Lifetime earned by Yearn Vaults" figure, ported from the yearn-earn app and rendered with
@number-flow/react. The server reads the compute bot'slifetime_yield:headlinesnapshot from Upstash Redis at ISR revalidation time (landing page revalidates every 6h) and passes it down as a prop; the client extrapolates forward from the snapshot using the published 30d-averaged rate, rolling digits at the whole-dollar cadence.A second commit sentence-cases the lander copy and unifies the hero description between desktop and mobile.
How to review
src/server/earnings/headline.ts(Redis read + extrapolation, null-on-failure policy) andsrc/components/shared/components/LifetimeEarningsStat.tsx(client ticking).app/page.tsx→app/page-client.tsx→src/components/pages/landing/index.tsx→Hero.tsx.publicDataHydration.tschanges are removal-only: the landing page's dehydrated query state existed solely to seed the old TVL number.771acd4d) is mechanical string changes; skimmable.Test plan
bun run tslint,bun run lint:fix,bunx vitest run src/server/ssr/publicDataHydration.test.ts(3/3)/api/earnings/headlinepath falls through to the 404 catch-allRisk / impact
UPSTASH_REDIS_REST_URL_EARNINGS+UPSTASH_REDIS_REST_TOKEN_EARNINGS(read-only token).@number-flow/react@0.6.0(~21KB gz incl. core, passed npm-policy review).🤖 Generated with Claude Code