Query editor
select date_trunc('{{Frequency}}', t.block_time) as period, sum(t.amount_usd) as vol, sum(t.amount_usd * s.fee / 1e6) as trading_fee, SUM(SUM(t.amount_usd)) OVER (ORDER BY DATE_TRUNC('{{Frequency}}', t.block_time)) AS cumulative_vol, SUM(sum(t.amount_usd * s.fee / 1e6)) OVER (ORDER BY DATE_TRUNC('{{Frequency}}', t.block_time)) AS cumulative_trading_volfrom dune.uniswap_fnd.result_uniswap_v_4_all_pools_data pleft join dex.trades t on t.project='uniswap' and t.version='4'and t.block_date >= date('2025-01-21') -- v4 contracts live dateand t.maker = p.poolleft join uniswap_v4_multichain.poolmanager_evt_swap s on s.chain = t.blockchainand s.evt_tx_hash = t.tx_hash and s.evt_block_number = t.block_numberand s.evt_index = t.evt_indexwhere p.hooks in ({{Hook Addresses}})group by 1order by 1 desc