Query editor
SELECTblockchain,SUM(amount_usd) AS swap_volume,SUM(amount_usd)*0.00875 AS swap_revenue,count(tx_hash) AS swap_trade,count(distinct tx_from) as swap_userFROM(SELECTblockchain,block_date,block_time,tx_from,amount_usd,tx_hash,rank() over(partition BY tx_hash order by evt_index DESC) AS rankedFROM dex.tradesWHERE tx_to IN (SELECT DISTINCT swap_router FROM dune.wenjuan.dataset_wallet_swap_router WHERE wallet = 'MetaMask'))tabWHERE ranked = 1GROUP BY blockchainORDER BY swap_volume DESC