select
a.block_timestamp::date "Date",
case when "Date" >= '2022-11-08' then 'After FTX Collapse' else 'Before FTX Collapse' end "TimeSpan",
count(distinct a.tx_id) "TX Number",
count(distinct tx_from) "Users"
from solana.core.fact_events a
join solana.core.fact_transfers b
on a.tx_id = b.tx_id
join solana.core.dim_labels on program_id = address
where label_type in ('dex', 'defi')
and "Date" >= '2022-11-01'
group by 1, 2
order by 1 asc