mz0111osmosis 907 8
Updated 2023-02-17Copy Reference Fork
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
›
⌄
with tab1 as
((select
'Swap From MARS' as swap_type,
trader as Swappers,
sum (from_amount/pow(10,6)) as Mars_Volume
from osmosis.core.fact_swaps
where from_currency = 'ibc/573FCD90FACEE750F55A8864EF7D38265F07E5A9273FA0E8DAFD39951332B580'
and block_timestamp >= CURRENT_DATE - 20
and TX_SUCCEEDED = 'TRUE'
group by 1 , 2
order by 3 DESC
)
union
(select
'Swap to MARS' as swap_type,
trader as Swappers,
sum (to_amount/pow(10,6)) as Mars_Volume
from osmosis.core.fact_swaps
where to_currency = 'ibc/573FCD90FACEE750F55A8864EF7D38265F07E5A9273FA0E8DAFD39951332B580'
and block_timestamp >= CURRENT_DATE - 20
and TX_SUCCEEDED = 'TRUE'
group by 1 ,2
order by 3 DESC
)
)
select*
from tab1
order by Mars_Volume desc
limit 10
Run a query to Download Data