damidezdistribution of transaction
Updated 2024-10-08
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
›
⌄
-- forked from distribution of volume @ https://flipsidecrypto.xyz/studio/queries/dc434018-2625-48c7-ab5c-5dc923fe3c61
WITH rango AS (
SELECT
from_address,
COUNT(DISTINCT tx_id) AS transaction_count
FROM thorchain.defi.fact_swaps
WHERE affiliate_address = 'rg'
GROUP BY from_address
)
SELECT
COUNT(DISTINCT from_address) AS Users,
CASE
WHEN transaction_count < 10 THEN '<10'
WHEN transaction_count >= 10 AND transaction_count < 20 THEN '10-20'
WHEN transaction_count >= 20 AND transaction_count < 50 THEN '20-50'
WHEN transaction_count >= 50 THEN '>50'
END AS Amount_Category
FROM rango
GROUP BY Amount_Category
ORDER BY Amount_Category;