Specterdistribution of tx
Updated 2024-10-20
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
›
⌄
WITH user_tx_count AS (
-- Count the number of transactions per user
SELECT
sender,
COUNT(*) AS tx_count
FROM
aptos.core.fact_transactions
WHERE
tx_type = 'user_transaction'
AND success = TRUE
AND block_timestamp >= '2024-01-01'
GROUP BY
sender
)
-- Group users by transaction count range
SELECT
CASE
WHEN tx_count < 20 THEN '< 20 transactions'
WHEN tx_count BETWEEN 20 AND 50 THEN '20-50 transactions'
WHEN tx_count BETWEEN 51 AND 100 THEN '51-100 transactions'
WHEN tx_count BETWEEN 101 AND 500 THEN '101-500 transactions'
ELSE '> 500 transactions'
END AS tx_range,
COUNT(DISTINCT sender) AS user_count
FROM
user_tx_count
GROUP BY
tx_range
ORDER BY
tx_range;
QueryRunArchived: QueryRun has been archived