Add Analytics page with protocol KPIs, revenue chart, and gauges#13
Open
WilliamPyke wants to merge 9 commits intomainfrom
Open
Add Analytics page with protocol KPIs, revenue chart, and gauges#13WilliamPyke wants to merge 9 commits intomainfrom
WilliamPyke wants to merge 9 commits intomainfrom
Conversation
✅ Deploy Preview for matchb0x ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
New /analytics route with five sections: KPI cards (TVL, locked BTC, epoch fees, voting power), historical protocol revenue bar chart from Supabase gauge_history, sortable/searchable gauges table, liquidity pools table with graceful earn-api fallback, and earning power area chart. Includes two new edge API routes, three data-fetching hooks using React Query, and a nav link in the header. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ea65a1f to
e51d5c3
Compare
Regenerates the lockfile so CI's frozen-lockfile install succeeds after adding recharts to apps/webapp/package.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Next.js strict build flags payload[0].payload as possibly undefined under noUncheckedIndexedAccess. Narrow the first entry explicitly before reading .payload so both analytics tooltips type-check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Skeleton from @mezo-org/mezo-clay requires the animation prop; other pages (Dashboard, Incentives, Boost) already pass it. Add it to all seven Skeleton usages across the analytics components so the Next.js type-check during build succeeds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tsconfig has exactOptionalPropertyTypes enabled, so sublabel?: string rejects the ternary 'kpis.btcPrice ? "@ $..." : undefined' expression passed from the BTC card. Widen sublabel and isLoading to include | undefined so explicit undefined is accepted. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Tag component's color prop only accepts blue/brown/gray/green/ purple/red/yellow. Use yellow as the accent for concentrated pools so the build type-checks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Tag component from @mezo-org/mezo-clay exposes closeable, not
kind. Match the pattern used in GaugeCard and LockCarouselSelector by
passing closeable={false} on all three pool-type Tags.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The gauge_history table is untyped in the generated Supabase types, so Supabase infers SelectQueryError for the select() result. Route the cast through unknown (as the compiler suggests) so the assertion to GaugeHistoryRow[] type-checks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces a new AnalyticsGaugeVotes section that surfaces per-gauge
veBTC/veMEZO vote allocations across every registered gauge (LP pools,
MUSD/BTC, MUSD Savings Rate, etc.) so voters can compare relative
weight at a glance.
- New edge API /api/analytics/gauge-votes-by-epoch reads per-gauge
rows from gauge_history for the last N epochs and returns both
vebtc_weight and vemezo_weight per gauge per epoch.
- New useGaugeVotesByEpoch hook wraps the endpoint with the
LONG_CACHE React Query profile.
- New AnalyticsGaugeVotes component adds:
* Toggle between veBTC and veMEZO vote basis
* Epoch selector (prev/next buttons + inline chip strip) for
time-travel across the last 12 epochs
* Per-gauge percentage bars with delta-vs-previous-epoch column
* "new" / "dropped" tags for gauges entering/leaving the set
* KPI strip with total weight, active gauges, epoch incentives,
and top gauge share
- gauge-history-aggregate now also aggregates vebtc_weight per epoch
so downstream charts can pivot on BTC-backed vote totals.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
New /analytics route with five sections: KPI cards (TVL, locked BTC, epoch fees, voting power), historical protocol revenue bar chart from Supabase gauge_history, sortable/searchable gauges table, liquidity pools table with graceful earn-api fallback, and earning power area chart. Includes two new edge API routes, three data-fetching hooks using React Query, and a nav link in the header.