Pine AnalyticsBlub metrics copy copy copy
Updated 2025-03-07Copy Reference Fork
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
›
⌄
select
case when swap_volume_usd < 10 then 'a/ below 10'
when swap_volume_usd < 100 then 'b/ 10-100'
when swap_volume_usd < 1000 then 'c/ 100-1K'
when swap_volume_usd < 10000 then 'd/ 1K-10K'
when swap_volume_usd < 100000 then 'e/ 10K-100K'
when swap_volume_usd < 1000000 then 'f/ 100K-1M'
else 'g/ 1M+' end as swap_volume_group,
count(*) as wallets,
sum(swap_volume_usd) as total_swap_volume
from (
select
ORIGIN_FROM_ADDRESS,
count(distinct tx_hash) as swaps,
sum(
case when not AMOUNT_IN_USD is null then AMOUNT_IN_USD
when not AMOUNT_out_USD is null then AMOUNT_out_USD end
) as swap_volume_usd
from avalanche.defi.ez_dex_swaps
where token_in like lower('0x0f669808d88B2b0b3D23214DCD2a1cc6A8B1B5cd')
or token_out like lower('0x0f669808d88B2b0b3D23214DCD2a1cc6A8B1B5cd')
group by 1
having not swap_volume_usd is null
order by 3 desc
)
group by 1
QueryRunArchived: QueryRun has been archived