hessCopy of new users
Updated 2022-11-17Copy 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
›
⌄
with tb1 as ( select trunc(block_timestamp,'day') as day,
unlock_date,
origin_from_address
from optimism.velodrome.ez_velo_locks
where velo_action = 'deposit' and DEPOSIT_TYPE in ('1','2')
and day >= '2022-11-15')
,
tb2 as ( select origin_from_address,
datediff('day', day , unlock_date) as number_of_days
from tb1)
select '1 Week' as status,
count(DISTINCT origin_from_address) as total_user
from tb2
where number_of_days <= 7
UNION
select 'Under a Month' as status,
count(DISTINCT origin_from_address) as total_user
from tb2
where number_of_days <= 30 and number_of_days > 7
UNION
select 'Under a Year' as status,
count(DISTINCT origin_from_address) as total_user
from tb2
where number_of_days <= 365 and number_of_days > 30
UNION
select 'Under two years' as status,
count(DISTINCT origin_from_address) as total_user
from tb2
where number_of_days <= 730 and number_of_days >365
UNION
select 'More than Two years' as status,
count(DISTINCT origin_from_address) as total_user
from tb2
where number_of_days > 730
Run a query to Download Data