feat: add vault history analytics#613
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 11 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughVault detail analytics now use unified Morpho Vault V2 history with RPC fallbacks. New charts display native yield, deposits, and share price. Position charts gain reusable skeleton loading states and configurable titles. ChangesVault history analytics
Reusable chart loading states
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant VaultView
participant VaultHistoryCharts
participant useVaultHistoryQuery
participant MorphoAPI
participant ArchiveRPC
VaultView->>VaultHistoryCharts: render selected vault and period
VaultHistoryCharts->>useVaultHistoryQuery: request cached history
useVaultHistoryQuery->>MorphoAPI: fetch Vault V2 historical state
MorphoAPI-->>useVaultHistoryQuery: native APY and total assets
useVaultHistoryQuery->>ArchiveRPC: fetch missing deposits or share price
ArchiveRPC-->>useVaultHistoryQuery: block-based metric series
useVaultHistoryQuery-->>VaultHistoryCharts: normalized metrics and sources
VaultHistoryCharts-->>VaultView: render analytics charts
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request replaces the single vault share price chart with a comprehensive vault history visualization system. It introduces the 'useVaultHistoryQuery' hook and 'VaultHistoryCharts' component to fetch and display native yield, total deposits, and share price history. Data is primarily retrieved from the Morpho API, with an on-chain archive RPC fallback for total assets and share price. Additionally, it refactors the period selector control, introduces a skeleton loading state for position history charts, and updates the technical documentation. No review comments were provided, so there is no feedback to address.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/features/positions/components/user-positions-chart.tsx`:
- Around line 61-71: Update UserPositionsChartSkeleton so its screen-reader
loading announcement incorporates the supplied title prop, keeping the
announcement synchronized with the visible chart heading, including custom
titles passed by VaultAdapterPositionOverview.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: dabb6c63-03a2-4028-a7ea-1d23e2668402
📒 Files selected for processing (15)
docs/TECHNICAL_OVERVIEW.mdsrc/data-sources/morpho-api/vault-history.tssrc/data-sources/morpho-api/vault-share-price-history.tssrc/data-sources/rpc/vault-history.tssrc/features/autovault/vault-view.tsxsrc/features/position-detail/components/history-tab.tsxsrc/features/positions/components/user-positions-chart.tsxsrc/features/vault/components/vault-adapter-position-overview.tsxsrc/features/vault/components/vault-analytics-period-control.tsxsrc/features/vault/components/vault-history-charts.tsxsrc/features/vault/components/vault-share-price-chart.tsxsrc/features/vault/vault-view.tsxsrc/graphql/vault-queries.tssrc/hooks/queries/useVaultHistoryQuery.tssrc/hooks/useVaultSharePriceHistory.ts
💤 Files with no reviewable changes (3)
- src/features/vault/components/vault-share-price-chart.tsx
- src/hooks/useVaultSharePriceHistory.ts
- src/data-sources/morpho-api/vault-share-price-history.ts
f24120c to
b0da659
Compare
Summary
Data architecture
avgApy,totalAssets, andsharePricesrc/data-sources/morpho-api/vault-history.tssrc/data-sources/rpc/vault-history.tstotalAssetspluspreviewRedeemat each historical blocksrc/hooks/queries/useVaultHistoryQuery.tsMonarch is not used for these vault series today because cumulative deposit and withdrawal events do not represent historical total assets after accrued yield. Full Monarch support needs historical vault-state snapshots or an equivalent accrued-assets series.
Validation
npx ultracite fixnpx ultracite checkpnpm typecheckpnpm buildPreview
Open any Vault V2 detail route. The expected order is native APR/APY, total deposits, vault exposure over time, market breakdown, then share price.
Summary by CodeRabbit