Query editor
with------------------------------ Raw Swaps ------------------------------swaps as (selectdate(block_timestamp) as date,tx_hash,swapper,token_bought_symbol,casewhen token_bought_symbol in ('DAI', 'USDC', 'USDT') then 'Stablecoin'when token_bought_symbol in ('ETH', 'WBTC') then 'Low Risk'when token_bought_symbol = 'STRK' then 'High Risk'else 'Other'end as token_type,token_bought_amount_usd as amount_usdfromdune.caravanserai.result_starknet_swapswheredate(block_timestamp) >= date('2024-02-20')),------------------------------ Aggregated Swaps ------------------------------result as (selectdate as "Date",token_type as "Type",count(distinct tx_hash) as "Swaps",count(distinct swapper) as "Swappers",sum(amount_usd) as "Volume"fromswapswheredate < current_dategroup bydate,token_type)------------------------------ Result ------------------------------select"Date","Type","Swaps","Swappers","Volume"fromresultorder by"Date" desc,"Volume" desc