select date_trunc('day',block_timestamp) as day,
case
when day >= '2021-03-03' and day < '2021-06-21' then 'Increaced Stability Fee'
when day >= '2021-06-21' and day < '2021-07-18' then 'Reduced Stability Fee'
when day >= '2021-07-18' and day < '2021-11-10' then 'Reduced Stability Fee'
when day >= '2021-11-10' and day < '2021-12-09' then 'Increaced Stability Fee'
when day >= '2021-12-09' and day < '2022-01-24' then 'Increaced Stability Fee'
when day >= '2021-01-24' and day < '2022-02-07' then 'Reduced Stability Fee'
when day >= '2021-02-07' and day < '2022-04-11' then 'Reduced Stability Fee'
when day >= '2021-04-11' and day < '2022-05-16' then 'Reduced Stability Fee'
else 'Reduced Stability Fee'
end as day2,
sum(amount_usd) as mint_amount,
count(distinct(tx_id)) as tx_number
from ethereum.udm_events
where symbol = 'DAI'
and from_address_name = 'genesis'
and origin_function_signature = '0x1cff79cd'
and event_name = 'transfer'
and day >= '2021-03-03'
group by 1