pouria-sharifzadAvalanche Current Active Wallets
Updated 2022-07-29Copy 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
›
⌄
WITH
active_users as (
SELECT
distinct from_address as active_user--,
--max(block_timestamp) as last_transaction
from avalanche.core.fact_transactions
where block_timestamp>=CURRENT_DATE-INTERVAL '3 MONTHS'
group by 1
),
active_users_n as (
select count (distinct active_user) as active_users_doing_transactions from active_users
),
active_users_2 as (
SELECT
distinct to_address as active_receiver--,
--max(block_timestamp) as last_transaction
from avalanche.core.fact_transactions --where to_address not in (select active_user from active_users)
where block_timestamp>=CURRENT_DATE-INTERVAL '3 MONTHS'
group by 1
),
active_users_21 as (
SELECT
count(distinct active_receiver) as active_users_receiving_tokens--,
--last_transaction
from active_users_2
where active_receiver not in (select active_user from active_users)
)
select
active_users_doing_transactions,
active_users_receiving_tokens,
active_users_doing_transactions+active_users_receiving_tokens as current_total_active_users
from active_users_n, active_users_21
Run a query to Download Data