NakedCollectorAvalanche Active Wallets
Updated 2024-07-17
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
›
⌄
-- forked from Active Wallets @ https://flipsidecrypto.xyz/edit/queries/ee1cff8f-5ee3-441b-a751-9082ea03fa78
-- New Users: Wallets with first transaction
with active as(
SELECT date_trunc('{{interval}}',block_timestamp) as date,
count(DISTINCT from_address) as active_wallets
FROM avalanche.core.fact_transactions
WHERE status = 'SUCCESS' and block_timestamp >= '{{start_date}}'
GROUP BY 1
),
new as (
SELECT date_trunc('{{interval}}',first_tx) as date,
count(DISTINCT from_address) as new_wallets,
sum(new_wallets)over(ORDER BY date) as cum_new_wallets
FROM
(SELECT from_address,
min (block_timestamp) as first_tx
FROM avalanche.core.fact_transactions
WHERE status = 'SUCCESS' and block_timestamp >= '{{start_date}}'
GROUP BY 1 )
GROUP BY 1
ORDER BY date DESC
)
,
combo as (
SELECT
*
FROM active
JOIN new
USING (date)
QueryRunArchived: QueryRun has been archived