Query editor
WITH bsol_trades AS (SELECTDATE(block_time) AS swap_date,CASEWHEN token_bought_mint_address = 'bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1' THEN token_sold_symbolWHEN token_sold_mint_address = 'bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1' THEN token_bought_symbolELSE 'Other'END AS pair_token,amount_usd,trader_id,tx_idFROM dex_solana.tradesWHERE(token_bought_mint_address = 'bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1'OR token_sold_mint_address = 'bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1')AND block_time > CURRENT_DATE - INTERVAL '7' DAY)SELECTswap_date,pair_token,SUM(amount_usd) AS daily_trade_volume_usd,COUNT(DISTINCT trader_id) AS daily_active_wallets,COUNT(DISTINCT tx_id) AS daily_swapsFROM bsol_tradesGROUP BY swap_date, pair_tokenORDER BY swap_date DESC, daily_trade_volume_usd DESC;