barbodswaps table to look at $COSG
Updated 2022-04-28
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
›
⌄
with from_ as (
select block_timestamp::date as date ,
sum (swap_from_amount) as volume
from algorand.swaps
where swap_from_asset_id = 571576867
and swap_from_amount > 0
group by 1
),
to_ as (
select block_timestamp::date as date ,
sum (swap_from_amount) as volume
from algorand.swaps
where swap_to_asset_id = 571576867
and swap_from_amount > 0
group by 1
),
all_ as (
select 'swap_from' as type,
* from from_
UNION all
select 'swap_to' as type,
* from to_
)
select type , date ,
sum (volume ) as volume
from all_
group by 1,2