SocioAnalyticanew user copy
Updated 2024-01-10
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
›
⌄
-- forked from new user @ https://flipsidecrypto.xyz/edit/queries/e7319d17-2f87-4a78-8569-de8828c1aaa8
with all_user as (
SELECT
block_timestamp,
tx_hash,
to_address,
from_address,
row_number() over (partition by from_address order by block_timestamp) as rank
FROM avalanche.core.fact_transactions
WHERE STATUS = 'SUCCESS'
)
SELECT
project_name,
label_type as sector,
count(DISTINCT from_address) as new_user
FROM all_user a
LEFT JOIN avalanche.core.dim_labels b
on a.to_address = b.address
WHERE block_timestamp BETWEEN '2023-01-01' AND '2023-12-31'
AND project_name is not null
AND label_type not in ('token', 'chadmin')
AND rank = 1
GROUP by 1 , 2
ORDER BY new_user DESC
LIMIT 30
QueryRunArchived: QueryRun has been archived