BlockTracker[nORMALIZE] Users Distribution by number of transaction
Updated 2025-04-22Copy 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
35
36
›
⌄
WITH users AS (
SELECT
block_timestamp,
from_address,
tx_hash
-- MIN(block_timestamp) OVER (PARTITION BY from_address) AS initial_timestamp,
-- MAX(block_timestamp) OVER (PARTITION BY from_address) AS last_timestamp
FROM monad.testnet.fact_transactions
WHERE block_timestamp::date >= '2025-02-18'
),
transactions AS (
SELECT
from_address,
COUNT(DISTINCT DATE_TRUNC('day', block_timestamp)) AS n_days,
COUNT(DISTINCT DATE_TRUNC('week', block_timestamp)) AS n_weeks,
COUNT(DISTINCT DATE_TRUNC('month', block_timestamp)) AS n_months,
COUNT(DISTINCT tx_hash) AS n_txns
FROM users
GROUP BY from_address
),
total_user_count AS (
SELECT
COUNT(DISTINCT from_address) AS total_users
FROM transactions
),
user_counts AS (
SELECT
t.from_address,
t.n_days,
t.n_weeks,
t.n_months,
t.n_txns,
tuc.total_users
FROM transactions t
CROSS JOIN total_user_count tuc
),
QueryRunArchived: QueryRun has been archived