Add 90-day APY component to historical APY calculation#329
Open
matheus1lva wants to merge 1 commit intomainfrom
Open
Add 90-day APY component to historical APY calculation#329matheus1lva wants to merge 1 commit intomainfrom
matheus1lva wants to merge 1 commit intomainfrom
Conversation
Add quarterly APY metrics to provide medium-term vault performance view: - Add quarterlyNet, quarterlyPricePerShare, quarterlyBlockNumber fields - Implement 90-day calculation logic following existing patterns - Store quarterly components in database output - Expose quarterly fields in GraphQL and REST APIs - Handle edge case for vaults younger than 90 days (returns undefined) - Add test coverage for quarterly APY calculations
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Adds a 90-day (quarterly) APY component to the historical APY calculation system, providing users with a medium-term performance view alongside the existing weekly, monthly, and inception metrics. This fills the gap between monthly (30-day) and inception timeframes for better vault performance analysis.
Closes #259
How to review
packages/ingest/abis/yearn/lib/apy.tsto see how quarterly APY follows the same pattern as weekly/monthlyquarterlyNet,quarterlyPricePerShare, andquarterlyBlockNumberpackages/web/app/api/gql/typeDefs/vault.ts) and REST API (packages/web/app/api/rest/list/db.ts) schema updatespackages/ingest/abis/yearn/lib/apy.spec.tsfor test assertions including edge case handlingThe changes are purely additive — no existing functionality is modified.
Test plan
through gql
Risk / impact
Low risk — This change follows the exact same pattern as existing weekly and monthly APY calculations:
Rollback: If issues arise, the quarterly fields can be safely ignored by clients — existing weekly/monthly/inception APY remain unchanged.