Skip to content

feat: real monthly BTC/USD, and a pseudo- prefix for invented data - #38

Merged
37ng merged 4 commits into
mainfrom
claude/bitcoin-price-extraction-af9801
Sep 8, 2026
Merged

37ng merged 4 commits into
mainfrom
claude/bitcoin-price-extraction-af9801

Conversation

@37ng

@37ng 37ng commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

Real price data

src/posts/bitcoin/data/price.json is now measured, not extracted from the pseudo bars. npm run bitcoin-price (scripts/generate-bitcoin-price.mjs) fetches the daily close series from blockchain.info's market-price chart and averages it per month.

Shape is flat, one lookup per month:

{ "2010-08": 0.0692857, "2011-06": 19.4423, "2026-09": 79185.3 }

194 months, 2010-08 to 2026-09. The series starts at 2010-08 because that is the first month with a traded price — the source reports every earlier day as 0, and those days are dropped rather than averaged in, since a zero means "no exchange yet", not a price. Values keep six significant figures, enough for both a $0.07 month and a $100k one.

Cross-checked against CoinGecko over the last 12 months: the two sources agree to about 0.1%.

The script is not wired into prebuild. A finished month never changes, and the open month would go stale between deploys anyway.

pseudo- prefix

Invented data now says so in its filename, so the status shows in an import line and in a directory listing, not only in a note inside the file:

  • bars.json → pseudo-bars.json
  • offchain-revenue-jan2023.json → pseudo-offchain-revenue-jan2023.json

epochs.json and the two mempool-space-*.json files are real measurements and keep their names. Imports, the offchain-pseudo npm script, and the doc comments that name these files are updated.

npm run check passes with 0 errors and npm run build succeeds.

🤖 Generated with Claude Code

37ng and others added 2 commits September 8, 2026 11:02
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@37ng 37ng changed the title feat: extract btc price into price.json feat: real monthly BTC/USD, and a pseudo- prefix for invented data Sep 8, 2026
37ng and others added 2 commits September 8, 2026 11:18
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@37ng
37ng merged commit 613c8ae into main Sep 8, 2026
1 check passed
@37ng
37ng deleted the claude/bitcoin-price-extraction-af9801 branch September 8, 2026 18:25
37ng added a commit that referenced this pull request Sep 8, 2026
* feat: add accelerator fees by pool to the bitcoin post

One stacked column per month of mempool.space accelerator fees, split by
the pool that took them, from mempool-space-by-month.json. Figures are BTC
to three significant digits; the exact sats stay in the readout and in
every hover title.

The axis is linear and stays linear. A band's height is the amount that
pool took and the top of a column is the month's total. A log axis reads
better -- months run from 0.004 BTC to 2.9 -- but stacking on a log scale
plots the running total, which leaves band heights meaning nothing. The
reader zooms instead: clicking a pool refits the axis to that pool's own
months, which is the only way a pool worth a tenth of a percent gets a
readable plot. Bands get no minimum height either, so they stay exactly
proportional; a pool too small to see is still reachable from the legend.

Hovering a pool drops the other thirteen, clicking keeps it alone, and
moving across the plot sets a month cursor that rewrites the readout and
every legend figure to that month.

Pools rank by lifetime total and take palette slots in that order, so the
biggest is always the floor of the stack and a pool keeps one color
everywhere. That needed fourteen slots, so --pool-1..4 are now aliases
onto a merged --series-1..14 rather than a second palette; --pool-5 stays
its own neutral because it is the residual bucket, not a series. Existing
figures render unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat: animate the stack when a pool is picked out

Clicking a pool snapped to the isolated chart. The bands of the other
thirteen pools were filtered out of the tree, and a node React unmounts
cannot be tweened.

Every band now stays mounted. The ones not chosen are driven to zero
height and zero opacity, so the stack drops to the floor while the chosen
pool slides down and grows into the refitted axis. Axis labels and
gridlines are keyed by slot rather than by tick value, so they survive a
rescale and slide instead of swapping.

.chart-move carries the timing: geometry eases over 320ms, opacity over
140ms, and the inline transitionDelay staggers geometry by column while
leaving opacity at zero delay -- a hover has to dim now, not a third of a
second later. Reduced motion keeps the opacity and drops the rest.

Also drops the sats line under the BTC figure in the readout. The line
keeps its height so selecting a pool does not shift the chart.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* polish: rename the accelerator chart, use the ₿ mark, tighten the legend

- Title reads "BTC offchain fee published by mempool.space" instead of
  "accelerator fees paid, by pool" -- names the source and the figure
  the way the rest of the post does.
- Readout and legend rows use ₿ instead of the "BTC"/"sats" text --
  bigger in the readout, dim and inline in the legend rows. The sats
  line under the big figure is dropped; the readout keeps its own
  height (min-h) so picking a pool does not shift the chart.
- Legend header row ("pool · every month") is dropped -- "show all"
  keeps its slot on the right so removing it does not shift the grid.
- Legend goes to a fixed two-column grid; the three-column layout on
  wide viewports was clipping pool names once the ₿ mark landed after
  the figure.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* feat: clear the isolated pool on Escape

Escape now clears `selected`, same effect as the "show all" button,
so a keyboard user can back out of a one-pool view without a mouse.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix: reserve constant height for the readout's share line

The share line and the legend's "show all" row used min-h with no
line-height, so their box grew past the reserved minimum once text
appeared, shifting the legend down. Pin height and line-height instead.

Also drop mempool-space-by-pool.json, reconstructible from
mempool-space-by-month.json, and remove the Escape-key handler for
the isolated pool view (not needed).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* feat: real monthly BTC/USD, and a pseudo- prefix for invented data (#38)

* feat: add dollar sign

* commit

* Merge branch 'main' into claude/bitcoin-mempool-diagram-b3f97f

* doc
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