KaskoazulCOSG swaps - daily
Updated 2022-04-30
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 swaps_to as (
select block_timestamp::date as fecha,
--swap_program as dex,
count (tx_group_id) as swaps,
sum(swap_to_amount) as volume
from algorand.swaps
where swap_to_asset_id = 571576867
group by 1
),
swaps_from as (
select block_timestamp::date as fecha,
--swap_program as dex,
count (tx_group_id) as swaps,
sum(swap_from_amount) as volume
from algorand.swaps
where swap_from_asset_id = 571576867
group by 1
)
select sto.fecha as days,
sto.swaps as swaps_to,
sum(swaps_to) over (order by days) as cum_swaps_to,
sto.volume as volume_to,
sum(volume_to) over (order by days) as cum_volume_to,
sfrom.swaps as swaps_from,
sum(swaps_from) over (order by days) as cum_swaps_from,
sfrom.volume as volume_from,
sum(volume_from) over (order by days) as cum_volume_from
from swaps_to sto
inner join swaps_from sfrom
on sto.fecha = sfrom.fecha
order by days desc