adriaparcerisasaxelar recap 7.2
Updated 2022-12-01
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
ins as (
SELECT
trunc(block_timestamp,'day') as date,
receiver as wallet,
sum(amount/pow(10,decimal)) as amount_in
from axelar.core.fact_transfers
where currency ='uaxl' and transfer_type in ('IBC_TRANSFER_IN','AXELAR')
group by 1,2
),
outs as (
SELECT
trunc(block_timestamp,'day') as date,
sender as wallet,
sum(amount/pow(10,decimal)) as amount_out
from axelar.core.fact_transfers
where currency ='uaxl' and transfer_type in ('IBC_TRANSFER_OUT','AXELAR')
group by 1,2
),
holders as (
SELECT
ifnull(ins.date,outs.date) as date,
ifnull(ins.wallet,outs.wallet) as address,
ifnull(amount_in,0)-ifnull(amount_out,0) as balance
from ins
full outer join outs on ins.wallet=outs.wallet and ins.date=outs.date
where amount_in is not null and amount_in>0
and amount_in<1e9 and amount_out<1e9 and amount_out>0
)
select
date,
case when balance<1 then '<1 AXL'
when balance >1 and balance<10 then 'Between 1-10 AXL'
when balance >10 and balance<100 then 'Between 10-100 AXL'
when balance >100 and balance<1000 then 'Between 100-1k AXL'
when balance >1000 and balance<10000 then 'Between 1k-10k AXL'
Run a query to Download Data