Query editor
with fees as (select time, fees_daily, sum(fees_daily) over (order by time) as cum_generate_feesfrom (select date_trunc('day', time) as time, sum(total_fees) as fees_dailyfrom (select time, total_feesfrom bitcoin.blocks) xgroup by 1order by 1 desc) t),reward as (select time, mined_daily, sum(mined_daily) over (order by time) as supply_BTCfrom (select date_trunc('day', time) as time, sum(total_reward) as mined_dailyfrom (select time, cast(total_reward as double) as total_rewardfrom bitcoin.blocks) xgroup by 1order by 1 desc) t),btc_supply as (select time, supply_BTC - cum_generate_fees as btc_circulation_supplyfrom feesleft join reward using(time)),btc_price as (select time, avg(price) as avg_pricefrom( select date_trunc('day', minute) as time, pricefrom prices.usd where symbol = 'WBTC') xgroup by 1order by 1 desc),diff as (select date_trunc('day', time) as time, avg(difficulty)/power(10, 12) as difficultyfrom bitcoin.blocksgroup by 1order by 1 desc),hashrate as (select time, avg(cast(difficulty as double)*(interval/600))/power(10, 11) as hash_ratefrom (select date_trunc('day', time) as time, difficulty, hour(time-lag(time, 1) over (order by height))*3600 + minute(time-lag(time, 1) over (order by height))*60 + second(time-lag(time, 1) over (order by height)) as intervalfrom bitcoin.blocks)group by 1order by 1 desc),summary as (select time, difficulty, hash_ratefrom diffjoin hashrate using(time))