KaskoazulgALGO3 swaps by ASA
Updated 2022-04-29
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 swap_to as (
select --s.block_timestamp::date as fecha,
case
when s.swap_to_asset_id != 0 then a.asset_name
else 'ALGO'
end as token_to,
count (tx_group_id) as swaps,
sum(swap_from_amount) as volume
from algorand.swaps s
left join algorand.asset a
on s.swap_to_asset_id = a.asset_id
where swap_from_asset_id = 694432641
group by 1--,2
),
swap_from as(
select --s.block_timestamp::date as fecha,
case
when s.swap_from_asset_id != 0 then a.asset_name
else 'ALGO'
end as token_from,
count (tx_group_id) as swaps,
sum(swap_to_amount) as volume
from algorand.swaps s
left join algorand.asset a
on s.swap_from_asset_id = a.asset_id
where swap_to_asset_id = 694432641
group by 1--,2
)
select s.token_to,
s.swaps as swaps_to,
s.volume as volume_to,
f.swaps as swaps_from,
f.volume as volume_from