NavidCopy of Copy of Untitled Query
Updated 2022-12-03
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 buys as (
select
date(block_timestamp) as day,
receiver as address,
amount/pow(10,decimal) as volume
from
axelar.core.fact_transfers
where
currency='uaxl' and tx_succeeded
and transfer_type in ('AXELAR','IBC_TRANSFER_IN')
), sells as (
select
date(block_timestamp) as day,
sender as address,
amount/pow(10,decimal) as volume
from
axelar.core.fact_transfers
where
currency='uaxl' and tx_succeeded
and transfer_type in ('AXELAR','IBC_TRANSFER_OUT')
), axelar_balance as (
select
b.day,
b.address,
ifnull(sum(b.volume),0) - ifnull(sum(s.volume),0) as volu,
sum(volu) over (partition by b.address order by b.day asc) as volume
from
buys b join sells s on b.day=s.day and b.address=s.address
group by 1, 2
), osmosis_balance as (
select
date(date) as day,
sum(balance/pow(10,decimal)) as volume
from
osmosis.core.fact_daily_balances
where
Run a query to Download Data