select
trunc(block_timestamp,'week') as date,
platform,
count(distinct tx_hash) as swaps,
sum(swaps) over (partition by platform order by date) as total_swaps,
count(distinct origin_from_address) as active_swappers,
sum(amount_out_usd) as volume_usd,
sum(volume_usd) over (partition by platform order by date) as total_volume_usd
from base.defi.ez_dex_swaps
group by 1,2 order by 1 asc