0xHaM-dNew vs Recurring NFT Users
Updated 2024-10-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
›
⌄
with users as (
SELECT
block_timestamp,
tx_hash,
from_address as user,
FROM kaia.core.fact_transactions tx
JOIN (
SELECT
distinct tx_hash,
block_timestamp
FROM kaia.core.fact_event_logs
join kaia.core.dim_labels on contract_address = address
where label_type = 'dex'
AND tx_succeeded = 'TRUE'
) using(block_timestamp, tx_hash)
)
,DAU_u as (
SELECT
date_trunc('d', BLOCK_TIMESTAMP) as day,
count(DISTINCT user) as Active_users
FROM users
GROUP BY 1
)
,new as (
SELECT
date_trunc('d', first_tx) as day,
count(DISTINCT user) as new_user
FROM (
SELECT
user,
min(block_timestamp) as first_tx
FROM users
GROUP BY 1
)
GROUP BY 1
)