shadilInitial swap volumes of LUNA and UST
Updated 2022-04-14
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 luna_min_tbl as (
SELECT
min(date(block_timestamp)) as min_date
from thorchain.swaps
where pool_name like '%LUNA%'
),
ust_min_tbl as (
SELECT
min(date(block_timestamp)) as min_date
from thorchain.swaps
where pool_name like '%UST%'
),
-- swap volume tables
luna_data_tbl as (
SELECT
date(block_timestamp) as date,
sum(from_amount_usd) as vol,
'luna' as type
from thorchain.swaps
join luna_min_tbl m
where date(block_timestamp) BETWEEN m.min_date and dateadd(day, 2, m.min_date::date)
and from_asset like '%LUNA%'
group by date
),
luna_to_data_tbl as (
SELECT
date(block_timestamp) as date,
sum(to_amount_usd) as vol,
'luna' as type
from thorchain.swaps
join luna_min_tbl m
where date(block_timestamp) BETWEEN m.min_date and dateadd(day, 2, m.min_date::date)
and to_asset like '%LUNA%'
group by date
),
Run a query to Download Data