feat(priority-fees): rebuild the burn series the upstream stopped publishing - #18
Merged
Conversation
…lishing The pre-aggregated daily priority-fee chart stopped advancing on 2026-07-11 and has answered 200 with a frozen payload every day since, so nothing that reads it can draw a current line. Its `stats` rollup is computed on the fly and is still accurate to the minute, but it only ever reports one cumulative window ending now. Asking that rollup for every lookback across the window and differencing neighbouring answers reconstructs the series: the narrowest window is a bucket on its own, and each wider one contributes the slice it adds. Buckets carry the span they really cover rather than the nominal width, because the upstream occasionally clamps a window short, and inheriting that as a wider bucket is honest where silently shifting every later bucket onto the wrong hour is not. Windows stop at 7d since 168 h is the widest lookback the rollup accepts. Aggregates that differencing destroys — unique payers, avg, min, max — come from the single widest rollup instead of from summing buckets, and venue-wide fill counts ride along so a client can say what share of activity pays for priority rather than only what priority costs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013zGKQKm432ZKEw1GjVWPZG
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.
Why
/analytics/priority-fees/chart/dailystill answers 200, but its rows stopped advancing on 2026-07-11. Anything charting priority gas from it has been serving frozen data since, silently.The cumulative rollup next to it (
/analytics/priority-fees/stats?hours=N) is alive and fresh. It always reports[now-N, now], so differencing consecutiveNreconstructs a disjoint bucket series without needing the dead aggregation.What
New
GET /market/priority-fees/series?window=24h|7d.priorityFees.series.tsholds the arithmetic and nothing else: the hour ladder andcomputeBuckets, which differences the sorted rollups. Pure, so the edge cases are unit-testable.priorityFees.service.tsfans the ladder out (concurrency 6), caches per window (300 s / 900 s), and reads the HYPE price off the existingperp:marketscache.hours=30came back as 28.7 h); inheriting that keeps the totals exact instead of shifting every later bucket onto the wrong hour.meta.missingBuckets, so a consumer can say how much of the window really answered.Scope
Order priority only, and the response says so by omission. The gossip auction feed (read-path priority) is frozen at
2026-07-11T17:55:26, so that burn cannot be sized from our sources. Documented in the types header rather than left for the next reader to rediscover.Verification
sum(buckets.gas) == totals.gasto 6 decimals. 2.4 s cold, 0.010 s cached.INVALID_WINDOW.type-checkandlintclean.Verified against live upstream data, not fixtures.
🤖 Generated with Claude Code
https://claude.ai/code/session_013zGKQKm432ZKEw1GjVWPZG