select
block_timestamp::date as day,
iff(block_timestamp >= date('2022-12-23'), 'After BONK', 'Before BONK') as timespan,
count(distinct tx_id) as stakes_count,
count(distinct signers[0]) as stakers_count,
sum(stakes_count) over (order by day) as cumulative_stakes_count,
sum(stakers_count) over (order by day) as cumulative_stakers_count
from solana.core.fact_events
where event_type = 'delegate'
and event_type is not null
and succeeded = 1
and day >= date('2022-12-01')
group by 1, 2
order by 1