Skip to content

a perp table that cannot load says so instead of vanishing - #2719

Merged
Flotapponnier merged 1 commit into
devfrom
fix/capital-perp-cohort-unavailable
Sep 29, 2026
Merged

Flotapponnier merged 1 commit into
devfrom
fix/capital-perp-cohort-unavailable

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Found by checking the deployed page after #2718 rather than trusting the JSON.

The symptom

On staging after #2718 merged, /api/capital served all 25 perp venues while the rendered /capital had the prediction-market table and no perp table at all. Three consecutive API reads returned 25 rows, so the source is reliably up.

The cause

/api/capital is force-dynamic; the page is ISR on revalidate = 3600. One render missed the perp venue cohort snapshot, hub.perpOi came back empty, the hub.perpOi.length > 0 guard dropped the table, and that HTML was cached for an hour with nothing saying why.

This is the defect this page spent the week removing, one level up: a missing table reads exactly the way a missing cell did.

The fix

The section keeps its heading and renders a line in the table's place naming the source that did not answer, where the last measurements are (/perps and bench 271), and that /api/capital is read per request rather than cached with the page. perpVenueCohortLive on the hub carries the state so the Markdown view and the JSON agree with the HTML.

It still substitutes nothing. The only other open-interest reading available here is DeFiLlama's overview, which is a different measurement and is precisely what #2718 moved off. Filling the gap with it would undo that PR and hide an outage behind plausible numbers.

Verified locally, where the cohort snapshot is genuinely unreachable, so it is the exact failure case: the notice renders where the table would be, the section heading and the prediction-market table are unaffected.

pnpm validate 240 specs, pnpm typecheck, eslint clean, 367 tests pass.

Found by checking the deployed page after #2718 rather than the JSON:
/api/capital served all 25 perp venues while the rendered /capital had
the prediction-market table and no perp table at all. The API route is
per-request and the page is ISR on a one hour window, so one render that
missed the perp venue cohort snapshot cached a page with the table
silently gone, for an hour, with nothing saying why.

That is the defect this page spent the week removing, one level up: a
missing table reads the same way a missing cell did. The section now
keeps its heading and says which source did not answer, where the last
measurements are (the perps hub and bench 271) and that /api/capital is
read per request rather than cached with the page.

It still substitutes nothing. The only other open-interest reading
available here is DefiLlama's overview, which is a different measurement
and is what #2718 moved off; filling the gap with it would undo that
work and hide the outage behind plausible numbers.

`perpVenueCohortLive` on the hub carries the state so the Markdown view
and /api/capital say the same thing as the HTML.
@Flotapponnier
Flotapponnier merged commit d0b91c6 into dev Sep 29, 2026
2 checks passed
@Flotapponnier
Flotapponnier deleted the fix/capital-perp-cohort-unavailable branch September 29, 2026 20:00
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