Query editor
with swap_fees as (selectevt_tx_hash, evt_index, evt_block_number, fee / 1e6 as fee_tier, chainfrom uniswap_v4_multichain.poolmanager_evt_swap), base as (selectf.*, t.amount_usd as swap_amount_usd, cast(t.amount_usd as double) * cast(f.fee_tier as double) as swap_fee_usdfrom swap_fees finner join dex.trades t on t.block_number = f.evt_block_numberand t.blockchain = f.chainand t.tx_hash = f.evt_tx_hashand t.evt_index = f.evt_index)selectchain, sum(swap_fee_usd) as total_swap_fee_usdfrom basegroup bychainorder by2 desc