amir007Open Analyitics Bounty: Arbitrum - New Wallets (Past Month)
Updated 2022-07-25Copy 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
›
⌄
with users_tx as
(
select from_address as user
, block_timestamp
from arbitrum.core.fact_transactions
where from_address != '0x0000000000000000000000000000000000000000'
union
select to_address as user
, block_timestamp
from arbitrum.core.fact_transactions
where to_address != '0x0000000000000000000000000000000000000000'
), new_users as
(
select user
, min(block_timestamp) as min_time
from users_tx
group by 1
having min(block_timestamp) between CURRENT_DATE - 30 and CURRENT_DATE
order by 2
), new_users_weekly as
(
select date_trunc('week', min_time) as week
, count(distinct user) as new_users_count
from new_users
group by 1
order by 1
)
select cast(week as date) as "Date (week)",
new_users_count as "Number of New Wallets (#)",
sum(new_users_count) over (order by week) as "Number of New Wallets over Week (#)"
from new_users_weekly
order by week
Run a query to Download Data