The Signal That Has Marked Every BTC Bear-Cycle Bottom

Charles Edwards published the Hash Ribbon in 2019. It is a simple two-line indicator: the 30-day moving average of BTC hashrate against the 60-day moving average. When the 30dMA crosses below the 60dMA, miners are switching off rigs — they can't pay the electricity bill at the current price. That's the capitulation phase.

When the 30dMA crosses back above the 60dMA, the survivors are profitable again. Every BTC cycle bottom since 2012 has been within days of that crossover. It is the closest thing crypto has to a deterministic bottom signal — and it is now exposed as a single API call.

Crypto Data API computes this nightly from mempool.space's public hashrate index and serves it at /api/v1/on-chain/miners/hash-ribbon. This post shows AI agent developers how to consume the endpoint, interpret the state machine, and avoid the standard false-positive trap.

What the Hash Ribbon Endpoint Returns

The full response is a clean state-machine read with the MAs themselves for charting:

curl -H "X-API-Key: cdk_live_yourkey" \
  "https://cryptodataapi.com/api/v1/on-chain/miners/hash-ribbon"

Real response from the live endpoint at the time of writing:

{
  "as_of": 1779964240,
  "state": "recovery",
  "days_in_state": 5,
  "last_crossover_ts": 1779580800,
  "hashrate_eh": 949.12,
  "ma30_eh":     977.46,
  "ma60_eh":     968.54,
  "ratio_ma30_over_ma60": 1.0092,
  "compressed": false,
  "history_days": 1037
}

The state field is the action-relevant one. Three values:

At the time of this post the endpoint is reporting recovery at day 5 — the cross-back-up happened roughly 5 days ago.

Why the Cross-Back-Up Is Mechanically Bullish

It is not pattern-matching mysticism. The mechanism is economic.

When BTC price falls below miners' marginal electricity cost, the least efficient miners shut off first. Their hashrate disappears from the network. The remaining miners — running newer ASICs and cheaper power — are more profitable per coin, because the next difficulty adjustment lowers the bar. The 30dMA falling under the 60dMA captures the exit phase.

When the 30dMA starts climbing back above the 60dMA, it means hashrate is coming back — meaning the surviving miners have grown confident enough in price to expand operations, and likely new capacity is being installed. That confidence usually requires price to have recovered first. The cross is the lagging-but-clean confirmation that the miners — the most economically motivated and best-informed participants in the BTC ecosystem — have called the bottom.

This is a structural signal, not a technical one. It is hard to fake at scale because it requires real electricity and real chip purchases.

Wiring the Hash Ribbon Into an Agent State Machine

Because the signal is a state (not a continuous reading), the integration is event-driven rather than polled. A practical pattern:

import asyncio, httpx

API = "https://cryptodataapi.com/api/v1"
KEY = "cdk_live_yourkey"
HEADERS = {"X-API-Key": KEY}

STATE_BIAS = {
    "recovery":     {"btc_bias": "strong_long", "score": 90},
    "normal":       {"btc_bias": "neutral",     "score": 50},
    "capitulation": {"btc_bias": "defensive",   "score": 25},
}

_last_state: str | None = None

async def poll_ribbon():
    global _last_state
    async with httpx.AsyncClient(timeout=10) as c:
        r = await c.get(f"{API}/on-chain/miners/hash-ribbon", headers=HEADERS)
        snap = r.json()
    state, days = snap["state"], snap["days_in_state"]
    if state != _last_state:
        bias = STATE_BIAS[state]
        await llm_alert(
            f"Hash Ribbon transitioned to '{state}' (day {days}).\n"
            f"Recommended BTC bias: {bias['btc_bias']}."
        )
        _last_state = state

async def loop():
    while True:
        await poll_ribbon()
        await asyncio.sleep(3600)  # hourly — the signal doesn't move faster

The agent only consumes a token-expensive LLM call when the state changes. That makes the Hash Ribbon a near-zero-cost regime overlay for a 24/7 trading bot.

The Standard False-Positive Trap (and How to Avoid It)

The Hash Ribbon is famously reliable on multi-month horizons. It is much noisier on weekly horizons. There is one specific failure mode every backtest reveals:

Short capitulation events. A 1-2 week dip in hashrate caused by a single weather event (Texas freeze, Sichuan flood-season migration), regulatory action (China 2021 ban), or major hardware turnover can trigger a brief capitulation/recovery cycle that has nothing to do with price cycle bottoms. The recovery cross fires, but BTC doesn't pop.

Two robust filters:

You can read MVRV from the companion /on-chain/dormancy/btc endpoint and combine them in your agent's decision logic. The composite /on-chain/score endpoint does this weighting automatically.

Hash Ribbon vs Other "Bottom" Signals

Most "bottom indicators" you read about online are pattern-matched price signals (RSI < 30, 200WMA tag, double-bottom on the weekly chart). The Hash Ribbon is fundamentally different — it's a structural read on miner economics:

SignalWhat it measuresReliabilityResolution
RSI < 30 weeklyPrice momentum exhaustionFires too oftenDays
200WMA tagLong-term moving average supportHistoric but not predictiveWeeks
MVRV < 1Realized loss territoryStrong historical fitDaily
Puell Multiple < 0.5Miner revenue stressStrong but rareDaily
Hash Ribbon recoveryMiner hashrate recoveryCleanest 4-cycle recordWeeks

The Hash Ribbon's edge is that it's late-but-clean. It will never catch the absolute low tick, but it has almost no false signals on multi-month horizons. For an AI agent allocating capital — where being approximately right at the right time beats being precisely right and early — that tradeoff is exactly the one you want.

What Does an AI Agent Actually Do When Recovery Fires?

The signal itself doesn't define position sizing or holding period. Three practical playbooks:

None of these playbooks are guaranteed. The endpoint surfaces a high-quality signal — the agent still has to combine it with sizing rules, drawdown limits, and other signals into an actual decision.

How to Plug Hash Ribbon Into Your Agent Today

Three-step minimal integration:

  1. Get a free API key at cryptodataapi.com.
  2. Add an hourly polling job hitting /api/v1/on-chain/miners/hash-ribbon.
  3. Trigger an LLM context update only on state transitions (not every poll).

For full cycle-position awareness, pair with:

Teams building production cycle-aware bots — including partners like Cabal Trader — consume the Hash Ribbon endpoint as part of their macro overlay. The signal is sourced from mempool.space's public hashrate index, computed nightly, and served pre-classified so your agent doesn't have to implement the state machine itself.