Query editor
WITH monthly_btc_fees AS (SELECTdate_trunc('month', time) as month_,SUM(total_fees) as monthly_fees_btcFROMbitcoin.blocksWHEREtime >= current_date - interval '1' yearGROUP BY1),btc_prices AS (SELECTdate_trunc('month', minute) as month_,AVG(price) as avg_btc_priceFROMprices.usdWHEREblockchain = 'bitcoin'AND symbol = 'WBTC'AND minute >= current_date - interval '1' yearGROUP BY1)SELECTf.month_,f.monthly_fees_btc,p.avg_btc_price,f.monthly_fees_btc * p.avg_btc_price as monthly_fees_usdFROMmonthly_btc_fees fLEFT JOIN btc_prices p ON f.month_ = p.month_ORDER BYf.month_ DESC