MLDZMNATR5
Updated 2022-12-02
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 tb1 as (
SELECT
receiver as users,
sum(amount/pow(10,decimal)) as volume_in
from axelar.core.fact_transfers
where currency ='uaxl'
and transfer_type in ('IBC_TRANSFER_IN','AXELAR')
group by 1
),
tb2 as (
SELECT
sender as users,
sum(amount/pow(10,decimal)) as volume_out
from axelar.core.fact_transfers
where currency ='uaxl'
and transfer_type in ('IBC_TRANSFER_OUT','AXELAR')
group by 1
),
tb3 as (
SELECT
s.users as holders,
ifnull(volume_in,0)-ifnull(volume_out,0) as AXL_balance
from tb1 s left join tb2 b on b.users=s.users
where volume_in<>0
and volume_out<>0
)
select
CASE
WHEN AXL_balance < 5 then 'a. Below 5'
WHEN AXL_balance < 100 then 'b. 5 - 100'
WHEN AXL_balance < 500 then 'c. 100 - 500'
WHEN AXL_balance < 2000 then 'd. 500 - 2,000'
WHEN AXL_balance < 10000 then 'e. 2,000 - 10,000'
Run a query to Download Data