select
date_trunc('day', block_timestamp) as date1,
case when date1 >= '2023-01-01' then '2023' else '2022'
END as Year_to_date,
sum(eth_value)
from optimism.core.fact_transactions
where date1 > current_date - 60
and ETH_value is not null
group by 1, 2