Skip to content

Replace landing TVL badge with lifetime earnings odometer#1305

Draft
murderteeth wants to merge 2 commits into
mainfrom
earn
Draft

Replace landing TVL badge with lifetime earnings odometer#1305
murderteeth wants to merge 2 commits into
mainfrom
earn

Conversation

@murderteeth

@murderteeth murderteeth commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

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's lifetime_yield:headline snapshot 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

  • Start with src/server/earnings/headline.ts (Redis read + extrapolation, null-on-failure policy) and src/components/shared/components/LifetimeEarningsStat.tsx (client ticking).
  • Then the prop path: app/page.tsxapp/page-client.tsxsrc/components/pages/landing/index.tsxHero.tsx.
  • publicDataHydration.ts changes are removal-only: the landing page's dehydrated query state existed solely to seed the old TVL number.
  • The copy commit (771acd4d) is mechanical string changes; skimmable.

Test plan

  • Automated: bun run tslint, bun run lint:fix, bunx vitest run src/server/ssr/publicDataHydration.test.ts (3/3)
  • Manual: dev server against the live Upstash instance — SSR HTML renders the extrapolated figure (~$310.3M) in both hero placements; odometer ticks client-side; old /api/earnings/headline path falls through to the 404 catch-all
  • Manual on preview deploy: badge renders once env vars are set (see below)

Risk / impact

  • Deploy prerequisite: Vercel needs UPSTASH_REDIS_REST_URL_EARNINGS + UPSTASH_REDIS_REST_TOKEN_EARNINGS (read-only token).
  • New dependency: @number-flow/react@0.6.0 (~21KB gz incl. core, passed npm-policy review).
  • No funds/auth/migration surface; the Redis credential is read-only and server-only. Rollback = revert the odometer commit (TvlStat removal is contained in it).

🤖 Generated with Claude Code

murderteeth and others added 2 commits July 7, 2026 04:30
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>
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
yearnfi Ready Ready Preview, Comment Jul 7, 2026 4:54am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
yearnfi-nextjs Ignored Ignored Jul 7, 2026 4:54am
yearnfi-nextjs-2 Ignored Ignored Jul 7, 2026 4:54am

Request Review

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
npm/@number-flow/react 0.6.0 UnknownUnknown

Scanned Files

  • package.json

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​number-flow/​react@​0.6.01001007383100

View full report

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.

1 participant