ML6Volume of Buyers and Sellers over time
Updated 2022-05-21
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 buying_swapper as (select count(distinct swapper) as cnt , date_trunc('day', block_timestamp) as dt from algorand.swaps
where (swap_from_asset_id=386195940 or swap_from_asset_id=386192725) and swap_from_amount is not null and swap_from_amount!=0
group by 2)
, buying_swapper_asset_name as (select count(distinct swapper) as cnt ,
( case
when swap_from_asset_id=386195940 then 'goETH'
when swap_from_asset_id=386192725 then 'goBTC'
END ) as asset_name
from algorand.swaps
where (swap_from_asset_id=386195940 or swap_from_asset_id=386192725) and swap_from_amount is not null and swap_from_amount!=0
group by 2)
,selling_swapper as (
select count(distinct swapper) as cnt , date_trunc('day', block_timestamp) as dt from algorand.swaps
where (swap_to_asset_id=386195940 or swap_to_asset_id=386192725) and swap_to_amount is not null and swap_to_amount !=0
group by 2)
, selling_swapper_asset_name as (
select count(distinct swapper) as cnt ,
( case
when swap_to_asset_id=386195940 then 'goETH'
when swap_to_asset_id=386192725 then 'goBTC'
END ) as asset_name
from algorand.swaps
where (swap_to_asset_id=386195940 or swap_to_asset_id=386192725) and swap_to_amount is not null and swap_to_amount !=0
group by 2)
, buying_volume as (select sum(swap_from_amount + swap_to_amount) as vol , date_trunc('day', block_timestamp) as dt from algorand.swaps
where (swap_from_asset_id=386195940 or swap_from_asset_id=386192725)
and swap_from_amount is not null and swap_from_amount!=0 and swap_to_amount is not null and swap_to_amount !=0
group by 2)
, buying_volume_asset_name as (select sum(swap_from_amount + swap_to_amount) as vol ,
( case
when swap_from_asset_id=386195940 then 'goETH'
when swap_from_asset_id=386192725 then 'goBTC'
END ) as asset_name
from algorand.swaps
where (swap_from_asset_id=386195940 or swap_from_asset_id=386192725)
and swap_from_amount is not null and swap_from_amount!=0 and swap_to_amount is not null and swap_to_amount !=0
Run a query to Download Data