fix: add lookback bounds to current performance queries#414
Open
matheus1lva wants to merge 1 commit into
Open
Conversation
- Add CURRENT_PERFORMANCE_LOOKBACK_DAYS env var (default 7) for APY/APR queries in apy-apr.ts. Also adds the lookback filter to getLatestApy and getLatestOracleApr which previously had no time bound. - Add STRATEGY_PERFORMANCE_LOOKBACK_DAYS env var (default 14) for the strategy performance CTE in the v3 vault snapshot hook. Kept separate from the 7-day default since strategy reports may lag. - Preserve single-timestamp invariant in fetchStrategyPerformance: restore the original CTE pattern (GROUP BY address, label → MAX block_time) with the added time bound, instead of DISTINCT ON which could pick components from different block_times. - JSONB projection changes (args->>field) for evmlog queries to reduce transfer size.
|
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
Split from #400 per review feedback — PR 2 of the split.
Changes
apy-apr.ts. Also adds the lookback filter togetLatestApyandgetLatestOracleAprwhich previously had no time bound.fetchStrategyPerformance: restores the original CTE pattern (GROUP BY address, label → MAX block_time) with the added time bound, instead ofDISTINCT ONwhich could pick components from differentblock_times.args->>'field'instead ofSELECT args) to reduce transfer size.Reviewer feedback addressed
DISTINCT ON)From
Split from #400 (PR 2 per review request). Remaining projection changes (things.ts pushdown, first→firstRow refactors in timeseries hooks) deferred until PRs 1+2 are measured.