-- forked from russwest / Miners' Monthly Revenue Breakdown @ https://flipsidecrypto.xyz/russwest/q/9XXcY3TG5nLm/miners-monthly-revenue-breakdown
select date_trunc('month', block_timestamp) as month,
'Block Reward' as type,
sum(block_reward) as block_reward
from bitcoin.core.ez_miner_rewards
group by 1,2
union all
select date_trunc('month', block_timestamp) as month,
'Fee' as type,
sum(fee) as fee
from bitcoin.core.fact_transactions
group by 1,2