Skip to content

fix(perps): bump providers cache key + loosen vol/oi bands - #685

Merged
Flotapponnier merged 1 commit into
devfrom
fix/perp-ui-polish-cache-bump
Jun 24, 2026
Merged

fix(perps): bump providers cache key + loosen vol/oi bands#685
Flotapponnier merged 1 commit into
devfrom
fix/perp-ui-polish-cache-bump

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Summary

Three small fixes on top of PR #683 (perp cohort seed).

Diagnosis: why /products/ still 404 after #683

PR #683 added PERP_VENUE_SEED to src/lib/providers.ts to seed stub profiles for cohort venues with no bench appearance. The seed loop runs in the right place (before Array.from(byKey.values())) and getProvider() routes through the cached profile list, so the code path is correct.

Root cause: the unstable_cache key stayed providers-v1. Vercel ISR kept serving the pre-seed cached profile list, so getProvider("drift") returned undefined, notFound() fired, page 404d. The benchmarks tag would have eventually invalidated it, but in the meantime cohort venues stayed dark.

Fix: bump the cache key to providers-v2 with an inline doc comment explaining when to bump it (any time buildProviders() output shape changes).

Fix A: PromQL or-fallback mask risk (P1, doc only)

perp-stats.ts uses ... 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 the or behaves 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 (deprecate perp_funding_hold_24h_bps once 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)
  • Same for /products/vertex, /products/edgex, /products/extended, /products/aevo, /products/pacifica, /products/variational, /products/ostium, /products/grvt
  • /perps shows Lighter as teal (under 80x) not amber
  • /perps tooltip on the Vol/OI cell reads the new copy

- 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).
@Flotapponnier
Flotapponnier merged commit e28476b into dev Jun 24, 2026
1 check passed
@Flotapponnier
Flotapponnier deleted the fix/perp-ui-polish-cache-bump branch July 17, 2026 14:42
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