---
name: chain-brain
description: The Robinhood Chain regime brain (chain on/off switch for the coin brain), built 5 Oct 2026 - what runs where, the model, what was proven or killed. Read before touching /opt/chainbrain or /opt/brain/chain.json, or any "is the RH chain peaking / heating up" question.
sources: [cowork]
aliases: [chainbrain, chain brain, chain.json, chain on off, rh regime brain]
---
- [stated] 5 Oct 2026: Ben asked for a chain regime brain per the brief http://159.223.88.168/hx-c9ois/brx/chain-brain-brief.md : spot RH peaking and reheating, write /opt/brain/chain.json that the coin brain obeys (risk off = no buy alerts).
## What runs (kookwatch droplet)
- /opt/chainbrain/chainbrain.py every 15 min (systemd chainbrain.timer :02/15 AND cron 9-59/15, flock, skips if ran <5 min ago). Reads /opt/runtrack/runtrack.db (tokens, kline, rh_flow). Writes /opt/brain/chain.json + public http://159.223.88.168/chain.json and /hx-c9ois/chain.json.
- chainfix.py every 10 min (timer + cron): if chain.json older than 35 min, reruns and restarts timer silently; alertgate.down only after 90 min of failed fixes. Tested 5 Oct (stale file fixed in 2 s).
- score.py hourly :37: scores every run 72h later (basket drop 10% first / rise 10% first), writes /hx-c9ois/chain-scorecard.json. Ledger /opt/chainbrain/ledger.db (runs, changes, coll, outcome).
- Telegram only on confirmed change into PEAKING (risk off) or REHEATING (risk on), max one per 6h each, via alertgate._send. A new state must show twice in a row (30 min).
- Forward collectors started 5 Oct (logged to coll table): fomo fills (ERC20 Transfers FROM router 0xb92fe925dc43a0ecde6c8b1a2709c170ec4fff4f, unique buyers; router 0x039ec98a76f111092d4751365ff09dd2aec301e8 emits no logs), L1 bridge escrow ETH balance 0xDf8755334ce7A73cCF6b581C02eA649AE3E864b3 (diff = net inflow), X posts per hour hourly via /opt/xq.py. Skipped in pickguard priority mode.
- RPC notes: official RH RPC 429s when other jobs are busy (retry 2x built in); publicnode RH 403; dRPC free plan rejects all getLogs ("ranges over 10000 blocks").
## Model v1
- Universe: every RH coin that ever reached $500k, joining at its crossing hour (point in time), dead coins flat. Index = trimmed mean of price ratios.
- S = mean of z-scores (vs own last 7 days) of breadth 24h, basket 24h return, distance from 72h high. States: PEAKING S>0.657; REHEATING S<=-1.084 and breadth 6h > 24h; HOT 7d basket up; COOLING 24h after PEAKING; else COLD. risk on = HOT or REHEATING.
- Results and killed ideas: see [[trading-edge-hub-2]] 2026-10-05 lines. Only one big cycle (peak 1 to 7 Sep) in the data.
- First live read 5 Oct 09:00 Bangkok: PEAKING, risk off, S 1.64, 7d basket -17%, buyers vs sellers 24h 1.25.
- Rotation Watch (/opt/rotation) was not changed.
## Macro layer v1.1 (5 Oct 2026, big swings)
- [stated] Ben: zoom out to the whole chain history; he wants the major swing points (when to bridge in, when to get out) and the next swing low and high.
- Swing map (daily coin index, point in time): launch 7 Jul; wave 1 top 16 Jul; low 18 Aug (-64%); wave 2 top 3 Sep (+120% off low); since then -77% to 5 Oct, flat 2 to 5 Oct. Fees peak 4 Sep $31M/day, now ~$3 to 4.5M.
- /opt/chainbrain/macro.py (replays full history each run, refreshed hourly from chainbrain): HEATING = 12+ coins aged 3+ days crossing $500k in 3 days while index 40%+ under 45d high (fired 21 Aug, 3 days after the low, index then +92%). TOO HOT = fees 7d > 1.5x 28d AND new-launch crossings > 2x old-coin crossings (fired 16 Jul and 2 Sep, both one day from the top). COOLING after TOO HOT.
- chain.json risk = on only when macro HEATING and short term not PEAKING; risk_short keeps the 15 min view. Telegram on macro change: BUY (heating) / SELL (too hot) / HOLD OFF (cooling).
- 2 to 5 Oct: 74 brand new launches crossed $500k in 3 days (record) but only 4 old coins woke and fees did not rise: launch casino, not money returning. Part may be runtrack detection (it started 2 Oct). n = 1 bottom, 2 tops: thresholds hand-picked, TESTING.
## v1.2, 5 Oct 2026 (macro only)
- [stated] Ben switched the 15 min view off: big swings first, then later one timeframe lower (4h or 1h swings). chain.json state = macro state, risk = on only in HEATING; short term kept only as short_term_off receipt; no short term Telegram.
- [stated] Ben asked whether 12 should grow with the chain. Answer: yes. Old coins sitting under $500k that can wake again grew from about 20 (Aug) to about 415 (Oct), so revivals now happen as background noise. Rule now: wakeups = first crossings of 3+ day old coins PLUS revivals (back over $500k after 3+ days under), 3 day count must be 3x its own normal (median of prior 14 days, min 3) and at least 12, with index 40%+ under its 45d high. Same 21 Aug fire, no false fire in Sep. 5 Oct: 10 vs normal 12, need 36.
- TOO HOT still compares new launches against first time old crossings only (revivals delayed it to 4 Sep).
- Fees check (5 Oct): DefiLlama chain fees = app fees (Uniswap LPs, Pons, GMGN, fomo...), no gas, so Robinhood's gas rebate does not enter the number. Rebate history: 90 day gas rebate for Robinhood Wallet txs 1 Jul to 29 Sep (threshold cut $5 to $0.50); on 29 Sep extended: no gas on Robinhood Wallet swaps over $0.50 until 31 Dec 2026. Watch 31 Dec: activity may drop when it ends; the fee ratio is self relative so a cliff shows as COOLING, not a false TOO HOT.
## Solana check, 5 Oct 2026
- [stated] Ben asked to run the same daily big-swing high/low detection on Solana and where Solana is now.
- Data: CMC historical listings API (api.coinmarketcap.com/data-api/v3/cryptocurrency/listings/historical, 3 pages x 5000, free, ~0.6 s per call) filtered to Solana memes, 1,008 days; pump.fun + PumpSwap + letsbonk fees from DefiLlama. Clean: drop coins ever > $15B (fake caps), PUMP, USD1; equal weight log index is unusable (noise drag), use summed cap of coins >= $1M.
- Result: the RH bottom rule did not hold on Solana (see [[trading-edge-hub-2]] 5 Oct lines). Treat the RH HEATING signal as unproven; do not add Solana to chain.json until a bottom rule passes there.
## v1.3, 5 Oct 2026 (Ben: go for the Solana bottom hunt and optimise RH from all learnings)
- HEATING rule replaced: RH coin index closes back above its 20 day average after a 40%+ fall from its 90 day high (within 20 days), AND BTC (Coinbase daily) above its 50 day average. Replay: HEATING 24 Aug (old rule 21 Aug), TOO HOT 2 Sep, same tops. Old-coin wakeups kept as a receipt only. macro.py backups macro.py.bak-v2, chainbrain.py.bak-v12.
- Why: wakeups failed on Solana; the reclaim + BTC filter passed Solana in both halves. Funding signals unusable (BitMEX settled, Hyperliquid did not replicate).
- 5 Oct 09:40 Bangkok: COOLING, risk off, index 29% under its 20d average, BTC above 50d, fees 0.57x.
## v1.4 extras, 5 Oct 2026
- [stated] Ben: look at active wallets; replace BitMEX; do 10 more iterations on both chains; argue from gaps and from "we are missing something crucial"; how far is the RH bottom.
- /opt/chainbrain/extras.py (called from macro.py hourly, shown in chain.json macro.extras): RH active wallets 7d median vs 60d low (users_capitulated flag), Deribit funding 7d, fastest-rising fee venue + venue_breakout flag (share >= 10% and 2.5x last week). Info only, not rules. Backup macro.py.bak-v3.
- New free sources found: Artemis API (api.artemisxyz.com/data/{DAU,NEW_USERS,TXNS,STABLECOIN_MC}/?artemisIds=solana), Blockscout RH stats lines (works from container and droplet 5 Oct), Deribit and dYdX funding history, DefiLlama per-protocol fee breakdown. Dead: publicnode archive (needs token), DefiLlama bridge volume (paid), growthepie (403), CoinMetrics community (no SOL active addresses).
## Daily gauge v1, 5 Oct 2026
- [stated] Ben asked for percentages/scores on a scale with a daily update instead of a black and white switch; five iterations, outside the box.
- Rejected: a fitted probability model (logistic on 7 features) scored WORSE than random out of sample on Solana (AUC 0.24 to 0.47 across halves). Kept: transparent checklist.
- /opt/chainbrain/gauge.py, daily 08:47 Bangkok (chaingauge.timer) + cron 08:53, flock, once per Bangkok day, chainfix reruns it if gauge.json is over 26h old. Public: http://159.223.88.168/gauge.json. Telegram via alertgate: one message a day for Robinhood and Solana memes.
- BOTTOM score = 60% SETUP (cheap: 40%+ off 90d high; fees 60%+ below 90d peak; calm: 20d volatility lowest quarter) + 40% TRIGGER (above 20d avg; BTC above 50d; users near their low). TOP score = fees 1.3x normal, 20%+ above 20d avg, within 10% of 90d high.
- Solana receipts (Apr 2024 to Sep 2026, next 30d): setup 0-1 median -8%; setup 2+ +5%; setup 3 + trigger 1 +20% (44% hit +30%, 15% fell 25%, n=27); setup 3 + trigger 2 +59% (n=18). Top 3/3 median -12%, 47% fell 25%+.
- Caveat: on RH setup has been 3/3 since about 24 Sep while the index fell another ~31%; that is why the action is WAIT, not BUY.
- First send 5 Oct 10:30 Bangkok: Robinhood WAIT, bottom 73, top 0 (setup 3, trigger 1). Solana HOLD OFF, bottom 27, top 33.


