SELECT
BLOCK_TIMESTAMP::date as date,
sum (AMOUNT_IN) as ETH_amounts,
lag(ETH_amounts) ignore nulls over(order by date asc) as lag_ETH_amounts,
((ETH_amounts - lag_ETH_amounts)/ lag_ETH_amounts)*100 as ETH_amounts_volatility,
case
when date <'2022-09-14' then 'before_merge'
when date >= '2022-09-14' then 'after_merge'
end as merge_time
from ethereum.core.ez_dex_swaps
where SYMBOL_IN='WETH'
and BLOCK_TIMESTAMP >='2022-06-01'
group by 1