kiacryptoCumulative number of unique users
Updated 2022-11-14Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with min_stake as (
select
address,
min(block_timestamp) as min_date
from solana.core.fact_stake_pool_actions
where
block_timestamp::date >= current_date - 7 and
action ilike '%deposit%' and
succeeded = 'TRUE'
group by 1
),
min_unstake as (
select
address,
min(block_timestamp) as min_date
from solana.core.fact_stake_pool_actions
where
block_timestamp::date >= current_date - 7 and
(action ilike '%unstake%' or action ilike '%withdraw%') and
succeeded = 'TRUE'
group by 1
)
select
date_trunc('day', min_date) as date,
'stake' as type,
count(distinct address) as unique_user,
sum(unique_user) over (order by date) as cum_unique_user
from min_stake
group by 1
union all
select
date_trunc('day', min_date) as date,
'unstake' as type,
count(distinct address) as unique_user,
Run a query to Download Data