Query editor
with swap_fees as (select evt_tx_hash, evt_index, evt_block_number, fee / 1e6 as fee_tier, 'unichain' as chainfrom uniswap_v4_unichain.PoolManager_evt_Swap where evt_block_time >= DATE '2025-01-01'UNION ALL select evt_tx_hash, evt_index, evt_block_number, fee / 1e6, 'worldchain'from uniswap_v4_worldchain.PoolManager_evt_Swap where evt_block_time >= DATE '2025-01-01'UNION ALL select evt_tx_hash, evt_index, evt_block_number, fee / 1e6, 'ink'from uniswap_v4_ink.PoolManager_evt_Swap where evt_block_time >= DATE '2025-01-01'UNION ALL select evt_tx_hash, evt_index, evt_block_number, fee / 1e6, 'zora'from uniswap_v4_zora.PoolManager_evt_Swap where evt_block_time >= DATE '2025-01-01'UNION ALL select evt_tx_hash, evt_index, evt_block_number, fee / 1e6, 'blast'from uniswap_v4_blast.PoolManager_evt_Swap where evt_block_time >= DATE '2025-01-01'), base as (select f.chain, t.block_date, cast(t.amount_usd as double) * cast(f.fee_tier as double) as swap_fee_usdfrom swap_fees fjoin dex.trades ton t.block_number = f.evt_block_numberand t.blockchain = f.chainand t.tx_hash = f.evt_tx_hashand t.evt_index = f.evt_indexwhere t.project = 'uniswap'and t.version = '4'and t.blockchain in ('unichain','worldchain','ink','zora','blast')and t.block_date >= DATE '2025-01-01')select chain, block_date, sum(swap_fee_usd) as total_swap_fee_usdfrom basegroup by 1, 2