SELECT
trunc (block_timestamp,'day') as date,
--label,
case when block_timestamp < '2022-11-08' then 'Previous to FTX/Alameda news' else 'After the FTX/Alameda news' end as period,
count(distinct tx_id) as txs,
count(distinct INSTRUCTION:accounts[1]) as users
from solana.core.fact_events
join solana.core.dim_labels on program_id = address
WHERE label_type IN ('dex', 'defi') AND block_timestamp >= '2022-11-01'
GROUP BY 1, 2
order by 1 asc