Moejan9th13
Updated 2023-01-17
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 base as (select
s.*, d.LABEL as swap_from_symbol , l.LABEL as swap_to_symbol
from
terra.core.ez_swaps s ,
terra.core.dim_address_labels d , terra.core.dim_address_labels l
where
TO_CURRENCY = l.address
and
From_CURRENCY = d.address
and
BLOCK_TIMESTAMP between '2023-01-01' and CURRENT_DATE - 5
)
select
'Luna out' as type ,
iff(BLOCK_TIMESTAMP::date = '2023-01-09', 'Jan-9th', 'Other') as types,
sum(from_AMOUNT/pow(10,6)) AS Volume,
avg(from_AMOUNT/pow(10,6)) AS avg_Volume,
count(distinct TRADER) as TRADERs
from base
where swap_from_symbol ilike 'luna'
group by 2
union all
select
'Luna in' as type ,
iff(BLOCK_TIMESTAMP::date = '2023-01-09', 'Jan-9th', 'Other') as types,
sum(to_AMOUNT/pow(10,6)) AS Volume,
avg(to_AMOUNT/pow(10,6)) AS avg_Volume,
count(distinct TRADER) as TRADERs
from base
where swap_to_symbol ilike 'luna'
Run a query to Download Data