MLDZMNATR6
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
block_timestamp::date as date,
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,2
),
tb2 as (
SELECT
block_timestamp::date as date,
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,2
),
tb3 as (
SELECT
ifnull(a.date,b.date) as day,
ifnull(a.users,b.users) as holders,
ifnull(volume_in,0)-ifnull(volume_out,0) as AXL_balance
from tb1 a left join tb2 b on a.users=b.users and a.date=b.date
where volume_in<>0
and volume_out>0
)
select
day,
CASE
WHEN AXL_balance < 5 then 'a. Below 5'
WHEN AXL_balance < 100 then 'b. 5 - 100'
Run a query to Download Data