Query editor
WITH raw_uniswap AS (SELECTblock_date,tx_from,tx_hash,amount_usd,token_bought_address,version,'uniswap' AS projectFROM dex.tradesWHEREblockchain = 'ethereum'AND project = 'uniswap'AND block_date >= TRY_CAST('2023-11-01' AS DATE)AND version = '3'), raw_sushiswap AS (SELECTblock_date,tx_from,tx_hash,amount_usd,token_bought_address,version,'sushiswap' AS projectFROM dex.tradesWHEREblockchain = 'ethereum'AND project = 'sushiswap'AND block_date >= TRY_CAST('2023-11-01' AS DATE)), raw_pancakeswap AS (SELECTblock_date,tx_from,tx_hash,amount_usd,token_bought_address,version,'pancakeswap' AS projectFROM dex.tradesWHEREblockchain = 'ethereum'AND project = 'pancakeswap'AND block_date >= TRY_CAST('2023-11-01' AS DATE)), aggregate_tbl AS (SELECTblock_date,version,COUNT(tx_hash) AS daily_trade_count,COUNT(DISTINCT tx_from) AS daily_trader_count,SUM(amount_usd) AS daily_trade_amount_usd,COUNT(DISTINCT token_bought_address) AS daily_tokens_traded,projectFROM (SELECT*FROM raw_uniswapUNION ALLSELECT*FROM raw_sushiswap