select block_timestamp::date as date,
case when date >= '2022-11-08' then 'During and After FTX & Alameda Collapse'
else 'Before Collapse' end as timespan,
avg (token1_balance_usd + token0_balance_usd) as Average_Tokens_Balance
from ethereum.uniswapv3.ez_pool_stats
where block_timestamp >= CURRENT_DATE - 30
group by 1,2
order by 1