Skip to content

Repository files navigation

Mandala — free macro data stories

An open-source hub of free, no-paywall data stories about the world economy, by houtini: markets, employment, lifestyle, retail, commodities, energy and bond yields. Every page is a zero-build static site that builds itself in the browser from public data (FRED, the World Bank, Our World in Data, IMF PortWatch), with charts in Chart.js and a shared design system, light and dark (assets/macro.css + assets/macro.js).

Live hub: https://richybaxter.github.io/Mandala/

Stories live under dashboards/<slug>/, each a scrolling narrative with its own data + CI refresh. Built so far: When Does the Music Stop? (dashboards/music-stops/), Arterial Flow maritime chokepoints (dashboards/maritime/), and the flagship below.


The Bitcoin Spiral

A clean Bitcoin monitoring dashboard: Bitcoin price and the Power Law on a 4-year-cycle map, plus a live panel of valuation, sentiment, flow and network signals that synthesise into a single, plain-English verdict.

Spiral: https://richybaxter.github.io/Mandala/spiral.html · Dashboard: https://richybaxter.github.io/Mandala/dashboard.html

How it's built: the story and the stack, and how the pieces fit together.

Static site, zero backend: the page is plain HTML/SVG/JS and hydrates entirely in the browser from free public APIs. Deploys to GitHub Pages with no build step.

The Bitcoin Spiral

The spiral: how to read it

Element Meaning
Angle Position within the 4-year cycle (one full turn = 4 years; Jan of 2013/17/21/25 at east).
Radius Price on a log scale: $1 at the centre, each dashed ring a 10× level ($10 → $100k).
Price line colour Valuation, green → red, by where price sits in the Power-Law channel (cheap → expensive). Not order flow.
Orange spiral Power-Law floor / support.
Red spiral Power-Law resistance / cycle-top band.
Dashed line Power-Law fair value.
Radial ticks Spot-ETF net flow (outward green = buying, inward red = selling).
Markers Events diary: halvings, ETF launches, macro.

The Power Law follows log10(P) = a + 5.8·log10(d), where d is days since the genesis block (2009-01-03): a = -17.32 (floor), a = -17.01 (fair value), a = -16.5 (cycle-top band). The angle encodes the calendar 4-year cycle, not time-since-halving.

Live dashboard

A single static page that fetches everything client-side and renders:

  • Verdict banner: six signals (Power-Law oscillator, price vs fair value, Mayer Multiple, Pi Cycle distance, Fear & Greed, 7-day taker flow) blended into one weighted call: Accumulate / Lean buy / Neutral–Hold / Lean sell / Distribute.
  • Stat tiles: price + 24h, BTC/Gold ratio, fair value, price vs fair, PL oscillator, Mayer Multiple, MVRV, Fear & Greed, next difficulty adjustment, Lightning capacity, on-chain fees.
  • Interactive spiral: hover any monthly point for its historic price and the model's fair/floor/top levels that month.
  • Charts: price vs Power-Law channel (log), Pi Cycle Top, Mayer Multiple, Fear & Greed (60d), buy/sell taker-volume pressure, network hashrate (1y).
  • Flows & institutional news: credible feeds filtered for ETF flows and who's buying.
  • Key-dates diary: FOMC, CME/Deribit expiries (computed) and the halving, with countdowns.

Each panel degrades to "n/a" if a feed is rate-limited or CORS-blocked, so the page never breaks.

Data sources (all free)

Source Used for
CoinGecko price + 365-day history
Binance public (data-api.binance.vision) taker-volume pressure, PAXG (BTC/Gold), Pi Cycle history
alternative.me Fear & Greed index
mempool.space hashrate, difficulty, Lightning, fees
CoinMetrics community MVRV (best-effort)
Binance monthly (CI) real monthly closes that regenerate the spiral each deploy
CoinDesk / Cointelegraph / Bitcoin Magazine (CI) institutional news, fetched server-side into news.json
Farside Investors (CI) daily spot-BTC-ETF net flows into etf_flows.json

Embed the chart

The spiral is a single self-contained .svg:

<img src="https://richybaxter.github.io/Mandala/btc-mandala.svg"
     alt="The Bitcoin Spiral" style="max-width:100%;height:auto">

Regenerate / update data

The spiral is generated by generate.py (Python standard library only):

python3 generate.py            # writes btc-mandala.svg
python3 generate.py out.svg    # custom output path

Editable data lives in data/: btc-monthly.json (prices), events.csv (diary markers), flows.csv (ETF flows), diary.json (dashboard key dates). To refresh ETF flows from a free feed, point fetch_flows.py at a CSV source:

FLOWS_URL="https://your-free-source/btc-etf-daily.csv" python3 fetch_flows.py

Roadmap / TODO

  • AI market note: Pages build calls GitHub Models (token stays in CI, models: read), writing commentary.json rendered under the verdict banner; refreshes on a 6-hour cron. Falls back to a computed note if the model is unavailable. See .github/workflows/pages.yml + tools/.
  • Auto-refresh: dashboard reloads all feeds every 60s with an "updated Ns ago" timer.
  • Share image: Open Graph card so links unfurl with the spiral (og.png, generated by design/make_og.py).
  • Real spiral prices: Pages build refreshes monthly closes from Binance (tools/update_prices.py) before generating the SVG, so the spiral and its "you are here" point are always current.
  • Reliable news: feeds are fetched server-side in CI (tools/fetch_news.pynews.json); the flaky client-side rss2json bridge is gone.
  • Live ETF flows: tools/fetch_etf_flows.py scrapes Farside Investors in CI into etf_flows.json; dashboard renders a 90-day net-flow bar chart (best-effort; chart hides if the scrape fails).

Accuracy notes

From 2017-08 onward the spiral uses real monthly closes pulled from Binance in CI (refreshed every deploy, incl. the current month), so the recent path and "you are here" point are accurate. Pre-2017 months are the established historical series (approximate, sub-$1 early values omitted). The dashboard's tiles always use real-time price. The Power-Law parameters approximate G. Santostasi's published model.

Credit, licence & disclaimer

Dashboard and chart by houtini. The underlying Power-Law model is the work of G. Santostasi, whose cyclical visualisation inspired the spiral.

Educational only. Not financial advice. Code and output: MIT.

Releases

Packages

Contributors

Languages