Query editor
-- BITCOIN SECURITY INDEX (BSI), daily, entirely on-chain.-- BSI = annualised miner revenue / market cap. Both in BTC, so price cancels: BSI = annualised BTC revenue / BTC supply.-- Same construction as the armory's live figure (bsi-benchmarks.pages.dev): a trailing 7-day window (~1,008 blocks),-- per-block reward = (subsidy + fees) / blocks in the window, annualised at 52,560 blocks/year, over the supply at day end.-- Supply = cumulative block subsidy (bitcoin.blocks.mint_reward is the subsidy; total_fees is the fees). No USD anywhere.-- fee_share_pct = fees as a share of miner revenue in the same window. one_pct_line = the 1% threshold quoted by btcsecuritybudget.com.with d as (select date_trunc('day', time) as day, count(*) as blocks, sum(mint_reward) as subsidy_btc, sum(total_fees) as fees_btcfrom bitcoin.blocks group by 1),w as (select day, blocks, subsidy_btc, fees_btc,sum(subsidy_btc) over (order by day rows unbounded preceding) as supply_btc,sum(blocks) over (order by day rows between 6 preceding and current row) as blocks_7d,sum(subsidy_btc) over (order by day rows between 6 preceding and current row) as subsidy_7d,sum(fees_btc) over (order by day rows between 6 preceding and current row) as fees_7d,sum(blocks) over (order by day rows between 364 preceding and current row) as blocks_365d,sum(subsidy_btc + fees_btc) over (order by day rows between 364 preceding and current row) as revenue_365dfrom d)select day,round(100.0 * ((subsidy_7d + fees_7d) / blocks_7d) * 52560 / supply_btc, 4) as bsi_spot_pct,round(100.0 * (revenue_365d / blocks_365d) * 52560 / supply_btc, 4) as bsi_ttm_pct,round(100.0 * fees_7d / (subsidy_7d + fees_7d), 2) as fee_share_pct,1.0 as one_pct_line,supply_btc, subsidy_7d + fees_7d as revenue_btc_7d,round(100.0 * ((subsidy_7d + fees_7d) / blocks_7d) * 52560 / supply_btc, 4) as "BSI %",round(100.0 * (revenue_365d / blocks_365d) * 52560 / supply_btc, 4) as "BSI, trailing 12 months %",round(100.0 * fees_7d / (subsidy_7d + fees_7d), 2) as "Fee share %",1.0 as "1% line"from wwhere day >= date '2010-01-01' and day < date_trunc('day', now())order by day