Query editor
with camelotV2_swapData as (selectblock_time,hash,swapper,pool_address,case when amount0In_USD = 0 then amount1In_USD else amount0In_USD end as amountIn_usd,case when amount0Out_USD = 0 then amount1Out_USD else amount0Out_USD end as amountOut_usdfrom query_5043882),camelotV3_swapData as (selectblock_time,hash,swapper,pool_address,amount0_USD as amountIn_usd,amount1_USD as amountOut_usdfrom query_5048132),camelotV4_swapData as (selectblock_time,hash,swapper,pool_address,amount0_USD as amountIn_usd,amount1_USD as amountOut_usdfrom query_5053972),aggregate as (select*from camelotV2_swapDataunion allselect*from camelotV3_swapDataunion allselect*from camelotV4_swapData)select-- date_trunc('day',block_time) as daycount(distinct hash) as Tota_trades,count(distinct swapper) as Total_Swapper,sum(amountIn_usd) as Total_volume,count(distinct pool_address) as Active_poolsfrom aggregate-- group by 1