feat(analytics): protocol analytics dashboard + subgraph (adopts + fixes #241) - #270
Merged
Merged
Conversation
…nt + test placement Adopts mijinummi's protocol analytics dashboard (API route + Dashboard component) and the subgraph scaffolding (The Graph protocol indexer). Fixes two CI failures: 1. frontend/__tests__/pool.test.ts imported matchstick-as (a subgraph test framework not in frontend's deps) — moved to subgraph/tests/pool.test.ts where Graph projects expect matchstick tests to live. This also removes it from vitest's test roots (__tests__/). 2. prefer-const (5) and no-explicit-any (1) lint errors in pool.test.ts and route.ts fixed; route.ts error: any replaced with instanceof Error check. 3. Prettier run on route.ts and Dashboard.tsx.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
10 tasks
This branch was successfully deployed
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
Adopts @mijinummi's protocol analytics dashboard (original PR #241) into the org repo, resolves both CI failures, and supersedes the original PR.
What's included
app/api/v1/protocol/summary/route.ts— Next.js API route querying The Graph subgraph for protocol-level analytics (TVL, volume, active pools, daily trend, top pools by TVL). Response cached 60s via Next.jsrevalidate.app/components/Dashboard.tsx— client-sideAnalyticsDashboardcomponent rendering protocol stats, per-pool TVL/volume, and daily trend data.subgraph/— The Graph subgraph scaffolding:schema.graphql,subgraph.yaml,factory.ts,pool.ts(event handlers), plus ABI placeholders.Fixes vs original PR #241
frontend/__tests__/pool.test.tsimportedmatchstick-as/assembly/index— a subgraph test framework not in frontend's dependencies. Moved tosubgraph/tests/pool.test.tswhere The Graph projects expect matchstick tests to live. This also removes it from vitest's test roots (__tests__/), fixing theFailed to resolve importerror.prefer-constand 1×@typescript-eslint/no-explicit-anyinpool.test.ts(nowconstdeclarations,matchstick-astypes).route.tscatch (error: any)replaced withinstanceof Errorcheck.main.CI
Soroban build ✅ | Frontend lint ✅ | Node unit tests ✅ | React component tests ✅ | Playwright ✅ | Edge functions ✅ | Supabase ✅ | Vercel preview ✅
Closes #241 (superseded)