datavortexTraders per category
Updated 2024-12-17
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
36
›
⌄
WITH trader_categories AS (
SELECT
platform,
origin_from_address,
SUM(amount_in_usd) AS total_swap_volume_usd,
COUNT(DISTINCT tx_hash) AS total_swap_count
FROM
kaia.defi.ez_dex_swaps
GROUP BY
platform, origin_from_address
),
categorized_traders AS (
SELECT
platform,
origin_from_address,
total_swap_volume_usd,
total_swap_count,
CASE
WHEN total_swap_volume_usd > 100000 THEN 'Whale'
WHEN total_swap_volume_usd >= 10000 AND total_swap_volume_usd <= 99999 THEN 'Dolphin'
WHEN total_swap_volume_usd >= 1000 AND total_swap_volume_usd < 10000 THEN 'Shark'
WHEN total_swap_volume_usd >= 1 AND total_swap_volume_usd < 1000 THEN 'Plankton'
WHEN total_swap_volume_usd < 1 THEN 'Micro-Plankton'
END AS trader_category,
CASE
WHEN total_swap_volume_usd > 100000 THEN 1
WHEN total_swap_volume_usd >= 10000 AND total_swap_volume_usd <= 99999 THEN 2
WHEN total_swap_volume_usd >= 1000 AND total_swap_volume_usd < 10000 THEN 3
WHEN total_swap_volume_usd >= 1 AND total_swap_volume_usd < 1000 THEN 4
WHEN total_swap_volume_usd < 1 THEN 5
END AS category_order
FROM
trader_categories
)
SELECT
platform,
QueryRunArchived: QueryRun has been archived