Afonso_Diazusers based on their number of transactions
Updated 2025-02-19
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
›
⌄
WITH main AS (
SELECT
tx_id,
block_timestamp,
pool_address,
provider_address AS user,
pool_name,
platform,
token_a_amount_usd + token_b_amount_usd AS amount_usd,
action_type AS event_name
FROM solana.marinade.ez_liquidity_pool_actions
),
user_tx_counts AS (
SELECT
user,
COUNT(tx_id) AS txn_count
FROM main
GROUP BY user
),
user_categories AS (
SELECT
CASE
WHEN txn_count = 1 THEN 'One-time User'
WHEN txn_count BETWEEN 2 AND 5 THEN 'Casual User (2-5 txns)'
WHEN txn_count BETWEEN 6 AND 20 THEN 'Active User (6-20 txns)'
ELSE 'Power User (21+ txns)'
END AS activity_category,
COUNT(*) AS user_count
FROM user_tx_counts
GROUP BY activity_category
)
SELECT activity_category, user_count
FROM user_categories
ORDER BY user_count DESC
QueryRunArchived: QueryRun has been archived