cybergenlab[Ecosystem metrics] User growth
Updated 2024-11-16
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
›
⌄
--Get historical project user growth
with monthly_new_users as (
select
date_trunc('month', block_timestamp) as time,
coalesce((label_type), 'other') as category,
count(distinct from_address) as new_users,
from ethereum.core.fact_transactions as transactions
left join ethereum.core.dim_labels labels on transactions.to_address = labels.address
where block_timestamp >= dateadd(year, -3, date_trunc('month',current_date()))
and nonce = 0
and block_timestamp < date_trunc('month',current_date())
and category not in ('token', 'cex', 'chadmin', 'operator', 'flotsam', 'other')
and status = 'SUCCESS'
group by 1,2
)
, new_users_table as (
select
time,
sum(new_users) as new_users
from monthly_new_users
group by 1
)
, user_growth as (
select
time,
new_users,
sum(new_users) over (order by time) as users
from new_users_table
group by 1,2
)
select * from user_growth
order by 1 desc
QueryRunArchived: QueryRun has been archived