Afonso_Diazgrouping swappers
Updated 2025-05-10
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
main as (
select
tx_hash,
block_timestamp,
iff(amount_in_usd > 1e6, amount_out_usd, amount_in_usd) as amount_usd,
swapper,
symbol_in,
symbol_out
from
aptos.defi.ez_dex_swaps
where
amount_usd < 1e6
and platform = 'cellana'
),
swappers as (
select
swapper,
count(distinct tx_hash) as swaps
from
main
group by 1
)
select
case
when swaps = 1 then 'Single Swap'
when swaps <= 3 then '2 - 3 Swaps'
when swaps <= 7 then '4 - 7 Swaps'
when swaps <= 15 then '8 - 15 Swaps'
when swaps <= 30 then '16 - 30 Swaps'
when swaps <= 50 then '31 - 50 Swaps'
else 'High-Volume Swapper (50+ Swaps)'
end as type,
QueryRunArchived: QueryRun has been archived