feat(v4): feed-health endpoint for pre-borrow oracle freshness gate#341
Open
magpiecapital wants to merge 1 commit into
Open
feat(v4): feed-health endpoint for pre-borrow oracle freshness gate#341magpiecapital wants to merge 1 commit into
magpiecapital wants to merge 1 commit into
Conversation
Sprint Item 3 of 6 (feedback_v4_hardening_sprint_2026_06_17.md). GET /api/v1/v4/feed-health?mint=<base58> returns whether a token's V4 + default price feeds are fresh enough for a borrow to succeed. The site calls this BEFORE rendering the Borrow CTA — if the feed is cold (> 90s) or missing, the dashboard shows "Refreshing oracle…" and silently calls /api/v1/price/refresh instead of letting the user click Borrow into a StalePriceAttestation rejection on Phantom's wallet-side simulation. Three recommendation buckets the site UI can branch on: - "ready" — both feeds fresh, normal CTA - "refresh_recommended" — 60-90s old, fire refresh + still allow - "refresh_required" — > 90s or missing, hold CTA until refresh No mutations. Read-only allowlisted to enabled supported_mints (same DOS surface as /price/refresh). Safe to poll every few seconds while the borrow form is open. Per [[feedback_v4_hardening_sprint_2026_06_17]] Item 3. Pairs with the existing /api/v1/price/refresh (synchronous attest) and the 60s JIT attestation in cosign-borrow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
magpiecapital
force-pushed
the
feat/v4-feed-health
branch
from
June 24, 2026 17:59
52085ec to
97ca8cf
Compare
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.
Sprint Item 3 of 6 (feedback_v4_hardening_sprint_2026_06_17.md).
GET /api/v1/v4/feed-health?mint=X returns whether a token's V4 + default price feeds are fresh enough for a borrow. Three recommendation buckets the site UI can branch on: ready / refresh_recommended / refresh_required. No mutations. Allowlisted to enabled supported_mints (same DOS posture as /price/refresh). Pairs with existing /api/v1/price/refresh + cosign-borrow JIT.