MLDZMNka2
Updated 2024-01-04
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
›
⌄
with tb1 as (SELECT
To_ADDRESS,
sum(RAW_AMOUNT/1e18) as volume_receive
from avalanche.core.fact_token_transfers
where CONTRACT_ADDRESS = lower ('0x0EF27Ddc8F89D4886E89d630De089962FfC12E43')
group by 1),
tb2 as (SELECT
From_ADDRESS,
sum(RAW_AMOUNT/1e18) as volume_sent
from avalanche.core.fact_token_transfers
where CONTRACT_ADDRESS = lower ('0x0EF27Ddc8F89D4886E89d630De089962FfC12E43')
group by 1),
tb3 as (select
tb1.to_address as user,
ifnull(volume_receive,0) - ifnull(volume_sent,0) as volume_hold
from tb1
left outer join tb2 on tb1.to_address=tb2.From_ADDRESS
)
select
count(distinct user) as holders,
median(volume_hold) as median_volume,
avg(volume_hold) as average_volume
from tb3
where volume_hold>0
QueryRunArchived: QueryRun has been archived