fix(perps): bump providers cache key + loosen vol/oi bands - #685
Merged
Conversation
- Bump providers cache key v1 to v2 so the PERP_VENUE_SEED added in PR #683 actually surfaces (Vercel ISR was serving the pre-seed cached profile list, which is why /products/drift etc. kept 404ing). - Loosen Vol/OI bands from 50/200 to 80/300 so zero-fee venues like Lighter (~115x today) read as elevated rather than wash-traded. Tooltip copy updated to explain the new thresholds. - Document the PromQL or-fallback mask risk on the perp funding query (P1 audit item, no behavior change today).
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
Three small fixes on top of PR #683 (perp cohort seed).
Diagnosis: why /products/ still 404 after #683
PR #683 added
PERP_VENUE_SEEDtosrc/lib/providers.tsto seed stub profiles for cohort venues with no bench appearance. The seed loop runs in the right place (beforeArray.from(byKey.values())) andgetProvider()routes through the cached profile list, so the code path is correct.Root cause: the
unstable_cachekey stayedproviders-v1. Vercel ISR kept serving the pre-seed cached profile list, sogetProvider("drift")returnedundefined,notFound()fired, page 404d. Thebenchmarkstag would have eventually invalidated it, but in the meantime cohort venues stayed dark.Fix: bump the cache key to
providers-v2with an inline doc comment explaining when to bump it (any timebuildProviders()output shape changes).Fix A: PromQL or-fallback mask risk (P1, doc only)
perp-stats.tsuses... or avg_over_time(perp_funding_hold_24h_bps...)as a fallback to the bench 036 series. Today the two series share only{venue, asset}labels and the LHS is the broader feed, so theorbehaves as intended. The risk is silent masking if either harness adds an overlapping label later. Added a comment block explaining the contract and the clean fix (deprecateperp_funding_hold_24h_bpsonce the cohort harness covers all 16 venues). No code change.Fix B: Vol/OI bands too aggressive
Old: <50x normal, 50-200x amber, >200x red. Lighter prints ~115x today (zero taker fee, MM-biased order book) and read as amber for a structurally legit pattern.
New: <80x normal, 80-300x elevated, >300x flag. Tooltip rewritten to explain that high churn is normal for zero-fee venues and that >300x is the wash-trade threshold.
Fix C: AgeBadge
Sits in the Venue cell (independent of the Vol/OI cell). Verified visual hierarchy still works after the band loosening, no change needed.
Test plan
curl https://openchainbench.com/products/drift?t=...returns 200 after deploy (once Vercel ISR picks up the new cache key)