Skip to content

feat(v4): feed-health endpoint for pre-borrow oracle freshness gate#341

Open
magpiecapital wants to merge 1 commit into
mainfrom
feat/v4-feed-health
Open

feat(v4): feed-health endpoint for pre-borrow oracle freshness gate#341
magpiecapital wants to merge 1 commit into
mainfrom
feat/v4-feed-health

Conversation

@magpiecapital

Copy link
Copy Markdown
Owner

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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant