Add strategy estimated apr breakdown to yvusd#361
Open
matheus1lva wants to merge 4 commits intomainfrom
Open
Conversation
|
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
This PR fixes strategy-level estimated APR hydration for yvUSD snapshots by making the ingest pipeline derive the APR label from the vault first and then query each strategy with that same label.
What changed
packages/ingest/abis/yearn/3/vault/snapshot/hook.tsperformance.estimated.type) as the source label for strategy estimated APR lookups.name,latestReportApr, existingperformance) resolves reliably.{}when no data exists.packages/ingest/helpers/apy-apr.tsgetLatestEstimatedAprV3label filtering logic:LIKE '%-estimated-apr'when not providedpackages/web/app/api/rest/snapshot/db.tsWhy
yvusd-estimated-apris emitted relative to vault context and must be consistently resolved before strategy-level lookups. Without this, composition could return missing strategy APR,Unknownnames, empty performance objects, and null latest report APR due to snapshot row mismatch.Manual Testing
1) Configure focused local indexing input
Create/update your local config override with the following exact content (or equivalent merged config):
2) Run indexing
make dev).fanout abisfrom terminal UI (or run equivalent job trigger).3) Validate data in DB
Confirm latest estimated label exists for vault and strategies:
4) Refresh REST snapshot cache and run web
cd packages/web bun run app/api/rest/snapshot/refresh-snapshot.ts bun run dev5) Validate REST snapshot payload
curl -s http://localhost:3001/api/rest/snapshot/1/0x696d02db93291651ed510704c9b286841d506987 | jqExpected:
performance.estimated.typeis populated for vault when output exists.composition[*].nameis resolved (not universallyUnknownwhere strategy snapshot/meta exists).composition[*].latestReportApris populated where strategy report data exists.composition[*].performance.estimatedis present for strategies with matching output rows for the vault-derived label.performance: {}defaults when no performance data exists.6) Regression checks
getLatestEstimatedAprV3still returns expected values for previous labels (crv/velo/aero) where applicable.Results
It's just showing unknown becuase i constrained to only that address locally.