Query editor
WITH token_mapping AS (SELECTFROM_HEX(REGEXP_REPLACE(address, '^0x', '')) AS contract_address,token AS token_name,native_tokenFROM query_5591440WHERE chain = 'EVM'AND FROM_HEX(REGEXP_REPLACE(address, '^0x', '')) <> 0xe5c436b0a34df18f1dae98af344ca5122e7d57c4 -- excluding uPepe),expanded AS (SELECTDATE_TRUNC('day', t.block_time) AS day,t.blockchain AS chain,t.amount_usdFROM dex.trades tJOIN token_mapping tb ON t.token_bought_address = tb.contract_address-- WHERE t.blockchain IN ('base','arbitrum','worldchain','katana')UNION ALLSELECTDATE_TRUNC('day', t.block_time) AS day,t.blockchain AS chain,t.amount_usdFROM dex.trades tJOIN token_mapping ts ON t.token_sold_address = ts.contract_address--WHERE t.blockchain IN ('base','arbitrum','worldchain','katana'))SELECTday,chain,SUM(amount_usd) AS daily_volume_usdFROM expandedGROUP BY 1, 2ORDER BY day DESC, daily_volume_usd DESC;