with eth_volume as (
select
trunc(block_timestamp, 'month') as monthly,
sum(AMOUNT) as total_volume from ethereum.core.ez_token_transfers
where TO_ADDRESS in (
select address from ethereum.core.dim_labels where
label_type='layer2' and
label ilike '%optimism%'
)
and monthly >= '2022-01-01'
and symbol = 'USDT'
group by monthly
order by monthly
)
select * from eth_volume