SELECT
block_timestamp::date as date,
'All users' as status,
count(DISTINCT b.value) as uniq_user,
sum(uniq_user) over (order by date ASC) as cum_grwoth_uniq_user
FROM solana.core.fact_transactions, lateral flatten(input => signers) b
where block_timestamp::date >= '2022-09-01'
GROUP BY 1, 2
UNION
SELECT
block_timestamp::date as date,
'Staker users' as status,
count(DISTINCT b.value) as uniq_staker_user,
sum(uniq_staker_user) over (order by date ASC) as cum_grwoth_uniq_staker_user
FROM solana.core.fact_transactions, lateral flatten(input => signers) b
where block_timestamp::date >= '2022-09-01'
and instructions[0]:programId = 'Stake11111111111111111111111111111111111111'
GROUP BY 1,2