Query editor
SELECTcase when token_bought_symbol in ('USDC','DAI','USDT','USDCb','USDC.e','FRAX','USDS') or token_bought_symbol LIKE '%USD%' then 'stable'when token_bought_symbol LIKE '%ETH%' then 'eth/lst/lrt'when token_bought_symbol LIKE '%BTC%' then 'btc'when token_bought_symbol in ('BRETT', 'PEPE','DEGEN', 'APE','DOG','TOSHI','SPX','ANON') then 'memes'else 'alt'end as category,DATE_TRUNC('week', block_time) as time,SUM(CAST(amount_usd AS DOUBLE)) AS usd_volumeFROMdex_aggregator."trades" AS t /* AND block_time < date_trunc('week', Now()) -- Add this line to see stats from current week */WHEREblock_time > NOW() - INTERVAL '365' day and project in ('kyberswap','0x API', '1inch','odos','cow_protocol','paraswap','DODO X', 'tokenlon','sushiswap','bebop', 'velora'') --and amount_usd < 50e6GROUP BY1,2