sunshine-juliaATR 12
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
›
⌄
with tab1 as (select block_timestamp::date as date, tx_id, receiver, amount / pow (10,decimal) as Receive_Volume
from axelar.core.fact_transfers
where currency = 'uaxl'
and transfer_type in ('AXELAR','IBC_TRANSFER_IN')),
tab2 as (
select block_timestamp::date as date,tx_id,sender,amount / pow (10,decimal) as Send_Volume
from axelar.core.fact_transfers
where currency = 'uaxl'
and transfer_type in ('AXELAR','IBC_TRANSFER_OUT')),
tab3 as (
select tab1.date, receiver as AXL_Holder,
sum (Send_Volume) as sending_amount,
sum (Receive_Volume) as receiving_amount
from tab1, tab2 where tab1.Date = tab2.Date and Receiver = Sender
group by 1,2),
tab4 as (
select date, AXL_Holder, receiving_amount, sending_amount,
receiving_amount - sending_amount as AXL_Balance
from tab3)
select count (distinct AXL_Holder) as count_users
from tab4
Run a query to Download Data