Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/with sum_mint_reward as (SELECTsum(mint_reward) as sum_mint_reward,sum(total_fees) as sum_total_fees,date_trunc('day',time) as dayFROMbitcoin.blocksGROUP by time)SELECTday,sum(sum_mint_reward) over (order by day asc) as total_supply,sum(sum_total_fees) over (order by day asc) as lifetime_fees,(sum(sum_mint_reward) over(order by day asc) + sum(sum_total_fees) over (order by day asc) *p.price) as lifetime_revenue,21*1e6 as maximum_supply,p.price as price_usdFROMsum_mint_reward as sleft JOIN prices.usd as p on s.day = p.minute and p.symbol = 'BTC' and blockchain is nullorder by day asc