erenaxl token3
Updated 2022-12-03Copy 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
30
31
32
33
›
⌄
--credit 0xF82BA5A4651dB2a6590eE69A10866e65cccE72F5
with receiver as ( select receiver,
sum(amount/pow(10,decimal)) as axl_in
from axelar.core.fact_transfers
where transfer_type in ('AXELAR','IBC_TRANSFER_IN')
and currency = 'uaxl'
group by 1)
,
sender as (select sender,
sum(amount/pow(10,decimal)) as axl_out
from axelar.core.fact_transfers
where transfer_type in ('AXELAR','IBC_TRANSFER_OUT')
and currency = 'uaxl'
group by 1)
,
tb1 as ( select receiver as user,
axl_in-axl_out as balance
from receiver a join sender b on a.receiver = b.sender
order by 2 desc )
select 'Axelar' as chain,
count(DISTINCT user) as count_holder,
sum(balance) as axl_amount
from tb1
where balance > 0
UNION
select 'Osmosis' as chain,
count(DISTINCT address) as count_holder,
sum(balance/pow(10,decimal)) as axl_amount
from osmosis.core.fact_daily_balances
where CURRENCY = 'ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'
and date = CURRENT_DATE - 1
group by 1
Run a query to Download Data