with SCRT as (select * from osmosis.core.dim_labels where project_name='SCRT')
, daily as (select sum(to_amount) ,block_timestamp::date from osmosis.core.fact_swaps
where to_currency in (select address from SCRT)
and block_timestamp::date > getdate() - interval '93 days'
group by block_timestamp::date)
, monthday as (select sum(to_amount) ,dayofmonth(block_timestamp::date) as month from osmosis.core.fact_swaps
where to_currency in (select address from SCRT)
and block_timestamp::date > getdate() - interval '93 days'
group by month)
select * from monthday