Query editor
with data as (selecttx_id, block_time, token_bought_symbol, token_sold_symbol, casewhen (token_bought_mint_address = 'So11111111111111111111111111111111111111112' and token_sold_mint_address IN ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', 'A1KLoBrKBde8Ty9qtNQUtq3C2ortoC3u7twggz7sEto6'))or (token_sold_mint_address = 'So11111111111111111111111111111111111111112' and token_bought_mint_address IN ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', 'A1KLoBrKBde8Ty9qtNQUtq3C2ortoC3u7twggz7sEto6'))then 'sol_trade'else 'non_sol_trade'end as trade, amount_usdfrom dex_solana.trades), one_day as (select'1 days' as day, trade, count(distinct tx_id) as txs, sum(amount_usd) as total_volumefrom datawhere block_time >= now() - interval '1' daygroup by 1,2), seven_day as (select'7 days' as day, trade, count(distinct tx_id) as txs, sum(amount_usd) as total_volumefrom datawhere block_time >= now() - interval '7' daygroup by 1,2), thirty_day as (select'30 days' as day, trade, count(distinct tx_id) as txs, sum(amount_usd) as total_volumefrom datawhere block_time >= now() - interval '30' daygroup by 1,2)select * from one_dayunion allselect * from seven_dayunion allselect * from thirty_day