Specterdistribution of tx
Updated 2024-11-05
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
›
⌄
WITH user_tx_count AS (
-- Count the number of transactions per user
SELECT
origin_from_address AS donor,
COUNT(DISTINCT tx_hash) AS tx_count,
SUM(eth_amount_usd) AS total_amount_usd
FROM
crosschain.olas.ez_service_donations
GROUP BY
donor
)
-- origin_from_address AS donor,
-- COUNT(DISTINCT tx_hash) AS total_transactions,
-- SUM(eth_amount_usd) AS total_amount_usd
-- Group users by transaction count range
SELECT
CASE
WHEN tx_count < 5 THEN '< 5 transactions'
WHEN tx_count BETWEEN 5 AND 10 THEN '5-10 transactions'
WHEN tx_count BETWEEN 11 AND 11 THEN '11-20 transactions'
ELSE '> 20 transactions'
END AS tx_range,
COUNT(DISTINCT donor) AS user_count
FROM
user_tx_count
GROUP BY
tx_range
ORDER BY
tx_range;
QueryRunArchived: QueryRun has been archived