Data Sources
Where all data comes from, how it's collected, and why each source matters.
Overview
Five independent data feeds supply the BTC Regime scoring model. All data is stored in PostgreSQL and refreshed on a fixed cron schedule. Crypto market data comes from Coinglass and DefiLlama/CoinGecko, while macro indicators come from FMP and FRED.
| Source | API | Pillar fed | Frequency |
|---|---|---|---|
| Bitcoin Spot ETF Flows | Coinglass | Liquidity | Daily |
| Stablecoin Supply | DefiLlama + CoinGecko | Liquidity | Daily |
| Exchange Netflows | Coinglass | Liquidity | Every 2 hours |
| Derivatives (Funding, OI, Liquidations) | Coinglass | Derivatives + Volatility | Every 4 hours |
| Macro Indicators (DXY, US10Y, SPX, VIX) | FMP + FRED | Macro Context overlay | Daily |
1. Bitcoin Spot ETF Flows
Coinglass ETF API for daily net flows and AUM history. Aggregated across all major ETFs.
| Field | Description | Unit |
|---|---|---|
| date | Trading date | YYYY-MM-DD |
| total_net | Total net flow across all ETFs for the day | Millions USD |
| aum_usd | Total AUM across all ETFs | USD |
How it's used: The model sums the last 3 trading days of total_net (absolute USD millions) as the etf3dSum input. Thresholds are fixed dollar amounts: >$1B strongly bullish (+10), <−$500M strongly bearish (−10). Feeds Component A of the Liquidity pillar (45% weight within pillar).
Every 2 hours via /api/sync/daily. ETF data reflects the previous trading day's close.
2. Stablecoin Supply
- Market cap history: DefiLlama. Free, no key required.
- Total crypto market cap (for dominance): CoinGecko. Free, no key required.
| Field | Description | Unit |
|---|---|---|
| market_cap_billions | Total stablecoin market cap (all major coins) | Billions USD |
| supply_change_percent | 7-day % change in total supply | Percentage |
| dominance_percent | Stablecoin mcap / total crypto mcap x 100 | Percentage |
Why it matters: Stablecoin supply is a proxy for capital available within the crypto ecosystem. Rising supply indicates new capital entering. Contraction indicates capital leaving. The supply_change_percent (7-day change) feeds Component C of the Liquidity pillar (20% weight within pillar).
Every 2 hours via /api/sync/daily.
3. Exchange Netflows
Coinglass on-chain data for historical exchange balance and per-exchange breakdown. Results cached for 3 hours (1.5x the sync interval) to survive one failed sync.
| Field | Description | Unit |
|---|---|---|
| exchange_netflow | Net BTC value on exchanges (positive = inflow/distribution, negative = outflow/accumulation) | Millions USD |
Why it matters: Large outflows from exchanges have historically been associated with holding behavior; large inflows have historically been associated with distribution pressure. Feeds Component D of the Liquidity pillar (20% weight within pillar).
Every 2 hours via /api/sync/exchange-flows.
4. Derivatives: Funding Rate, Open Interest & Liquidations
Coinglass, which aggregates derivatives data from Binance, OKX, Bybit, and other major exchanges. Three feeds are collected: perpetual funding rates, aggregate open interest, and liquidation history.
| Field | Description | Unit |
|---|---|---|
| funding_rate_percent | Current 8h perpetual funding rate (Binance BTCUSDT) | % per 8h |
| open_interest_usd | Total notional open interest across all exchanges | USD |
| oi_change_24h_pct | 24-hour % change in OI (computed from stored history) | Percentage |
| liquidations_24h | Total liquidations in last 24 hours (Binance + OKX + Bybit) | Millions USD |
| avg_liquidations_7d | 7-day average daily liquidations | Millions USD |
Why it matters: Funding rate is contrarian: high positive funding means longs are overpaying, signaling overcrowded positioning and reversal risk. The Derivatives pillar uses two components: Funding Rate Z-Score (50%, gated by trend direction) and OI × Price Interaction (50%). OI data also feeds the Volatility pillar (15%) via realized volatility calculations.
Every 4 hours via /api/sync/derivatives.
5. Macro Indicators
SPX, VIX, forex pairs: Financial Modeling Prep (FMP). Free tier: 250 req/day.
US 10-Year yield: FRED (Federal Reserve), series DGS10.
DXY: Synthesized from 5 FMP forex pairs + 1 FRED series using the ICE DXY formula (see below).
| Field | Description | Source |
|---|---|---|
| dxy | US Dollar Index (synthesized from forex rates) | FMP + FRED (computed) |
| us10y | 10-year Treasury yield. Forward-filled on non-trading days. | FRED DGS10 |
| spx | S&P 500 daily close | FMP ^GSPC |
| vix | CBOE Volatility Index. Forward-filled on non-trading days. | FMP ^VIX |
50.14348112 × EURUSD^−0.576 × USDJPY^0.136
× GBPUSD^−0.119 × USDCAD^0.091
× USDSEK^0.042 × USDCHF^0.036This is a synthesized approximation using published ICE basket weights applied to FMP and FRED data. It is not sourced from ICE directly and may differ from the official DXY index. 400 calendar days of history fetched to support the 200-day moving average.
Important: Macro data feeds the Macro Context overlay only, not the BTC regime score. It provides an independent macro alignment signal without changing the regime direction. See Macro Context for details.
Every 2 hours via /api/sync/daily. Macro data from FMP and FRED updates after US market close; earlier runs will re-fetch the same values until new data is published.
Scoring-Related Sync Schedule
| Schedule | Endpoint | Data synced |
|---|---|---|
| Every 2 hours | /api/sync/daily | ETF flows, stablecoins (DefiLlama + CoinGecko), macro (FMP + FRED) |
| Every 2 hours | /api/sync/exchange-flows | Exchange netflows (Coinglass on-chain) |
| Every 4 hours | /api/sync/derivatives | Funding rate, OI, liquidations (Coinglass) |