Query editor
WITH tot_fees AS (SELECT date_trunc('day', time) AS time, SUM(p.price*total_fees) AS fees_usd, SUM(total_fees) AS feesFROM bitcoin.blocks bINNER JOIN prices.usd p ON date_trunc('minute', time) = p.minuteWHERE p.symbol='BTC'AND p.contract_address IS NULLAND b.height > 767429GROUP BY 1), ordinal_fees AS (SELECTdate_trunc('day', bt.block_time) AS time,SUM(bt.fee) AS ordinal_fees,SUM(bt.fee * pu.price) AS ordinal_fees_usdFROM bitcoin.transactions btLEFT JOIN prices.usd pu ON pu.symbol='BTC'AND pu.contract_address IS NULLAND pu.minute=date_trunc('minute', block_time)WHERE bt.block_height > 767429AND bt.output_value IS NOT NULLand cast(hex as varchar) LIKE '%0063036f726401%' -- hex decode of mint onlyGROUP BY 1)SELECTt.time AS day,ordinal_fees_usd,ordinal_fees,fees - ordinal_fees AS other_fees,fees_usd - ordinal_fees_usd AS other_fees_usdFROM tot_fees tINNER JOIN ordinal_fees o ON t.time = o.time