Afonso_DiazSwappers Breakdown
Updated 2025-03-09
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
›
⌄
WITH main AS (
SELECT
origin_from_address AS swapper,
tx_hash
FROM avalanche.defi.ez_dex_swaps
WHERE '0x8729438eb15e2c8b576fcc6aecda6a148776c0f5' IN (token_in, token_out)
),
swapper_counts AS (
SELECT
swapper,
COUNT(DISTINCT tx_hash) AS num_swaps
FROM main
GROUP BY swapper
),
categorized_swappers AS (
SELECT
swapper,
num_swaps,
CASE
WHEN num_swaps BETWEEN 1 AND 5 THEN 'Occasional Swapper (1-5 swaps)'
WHEN num_swaps BETWEEN 6 AND 50 THEN 'Regular Swapper (6-50 swaps)'
WHEN num_swaps BETWEEN 51 AND 200 THEN 'Frequent Swapper (51-200 swaps)'
ELSE 'Power Swapper (201+ swaps)'
END AS swapper_category
FROM swapper_counts
)
SELECT
swapper_category,
COUNT(DISTINCT swapper) AS num_swappers
FROM categorized_swappers
GROUP BY swapper_category
ORDER BY num_swappers DESC
QueryRunArchived: QueryRun has been archived