feat: add TVL/balance trend sparkline to pool cards#177
Merged
Sendi0011 merged 2 commits intoJul 21, 2026
Conversation
Sendi0011
self-requested a review
July 21, 2026 16:16
Sendi0011
approved these changes
Jul 21, 2026
Sendi0011
left a comment
Contributor
There was a problem hiding this comment.
Great Implementation @Yerimahjr
4 tasks
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.
Closes #142
What this does
pool-daily-metricssnapshot writer (/api/cron/snapshot-pool-metrics), triggered daily via Vercel Cron (seevercel.json)/api/pools/history) so the Explore/My Groups grid fetches history for all visible pools in one request instead of one per cardPoolSparkline, a lightweight inline SVG (no new charting dependency), showing the last 30 days of balance historypool-card.tsxnext to the "Total Saved" valueWhy no new table/migration
pool_daily_metricsalready existed (added in20260616080000_analytics_schema.sql) and was already being read in/api/analytics, but nothing was writing to it — this PR fills that gap rather than introducing a duplicate table.Degradation behavior
PoolSparklinereturnsnullfor pools with fewer than 2 data points, so new/empty pools just show no sparkline rather than a broken or misleading chart.Verification
NEXT_PUBLIC_SUPABASE_URLisn't available in my local env, so a fullnext buildisn't possible here — verified instead viatsc --noEmit(no new errors introduced; 14 pre-existing errors in unrelated files remain unchanged) andeslint(clean) on all changed/added files.Setup needed after merge
A
CRON_SECRETenv var needs to be added in Vercel project settings for the cron auth check to pass in production.