Skip to content

[GF-15] [FRONTEND] Analytics Page + Live Landing Page Stats #47

@wumibals

Description

@wumibals

Overview

⚠️ Depends on: #44 (GF-12 — Data Service Layer).

Build the /analytics page showing live protocol-wide metrics, and update the landing page stats bar to use real data instead of hardcoded values.

Problem

The landing page stats bar in app/src/app/page.tsx shows hardcoded static values:

<span className={styles.statValue}>4</span>        // always "4"
<span className={styles.statValue}>1.40×</span>     // always "1.40×"
<span className={styles.statValue}>0%</span>        // always "0%"
<span className={styles.statValue}>35%</span>       // always "35%"

These should reflect live protocol data (TVL, APY, depositor count). Additionally, no /analytics page exists for in-depth protocol stats — common on comparable DeFi protocols like Beefy Finance and Yearn Finance.

Proposed Solution

1. Create app/src/app/analytics/page.tsx

Protocol overview cards (top row):

  • Total TVL (aggregate across all vaults)
  • Current best APY (highest 7-day trailing APY across tiers)
  • Total yield harvested to date
  • Total number of unique depositors

TVL breakdown chart
A stacked bar or area chart showing TVL per vault tier over time (7d, 30d, all-time range selector).

APY per vault table

Vault Current APY 7-Day APY 30-Day APY
Flex X% X% X%
L3 X% X% X%
L6 X% X% X%
L12 X% X% X%

Harvest history feed
A chronological list of harvest events:

  • Date/ledger
  • Total yield harvested
  • Bounty paid (10 bps)
  • Caller address

Deposit/withdrawal activity chart
Net capital flow (deposits minus withdrawals) per day over the last 30 days.

2. Update landing page stats bar
Replace the four hardcoded stat values with live data:

  • Total TVL (from useTVL())
  • Best current APY (from useAPY())
  • Protocol fee: keep as 0% (correct, hardcoded is fine here)
  • Max pool exposure: keep as 35% (correct, hardcoded is fine here)

Add Portfolio link to the nav for the analytics page.

Acceptance Criteria

  • /analytics page exists with all four overview stat cards showing live data
  • TVL breakdown chart renders with real per-tier TVL data
  • APY table shows current, 7-day, and 30-day APY for all four tiers
  • Harvest history feed shows real harvest events in chronological order
  • Time range selector (7d / 30d / all-time) updates all charts
  • Landing page stats bar TVL and APY values are live (not hardcoded)
  • Protocol fee (0%) and max pool exposure (35%) can remain hardcoded (they are protocol constants)
  • All charts handle the loading state gracefully (skeleton or spinner)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions