shadilInitial swap volumes of Doge
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 doge_min_tbl as (
SELECT
min(date(block_timestamp)) as min_date
from thorchain.swaps
where pool_name like '%DOGE%'
),
-- swap volume tables
doge_data_tbl as (
SELECT
date(block_timestamp) as date,
sum(from_amount_usd) as vol,
'doge' as type
from thorchain.swaps
join doge_min_tbl m
where date(block_timestamp) BETWEEN m.min_date and dateadd(day, 2, m.min_date::date)
and from_asset like '%DOGE%'
group by date
),
doge_t0_data_tbl as (
SELECT
date(block_timestamp) as date,
sum(to_amount_usd) as vol,
'doge' as type
from thorchain.swaps
join doge_min_tbl m
where date(block_timestamp) BETWEEN m.min_date and dateadd(day, 2, m.min_date::date)
and to_asset like '%DOGE%'
group by date
)
SELECT date, sum(vol) as vol, type from (
select * from doge_data_tbl
UNION
select * from doge_t0_data_tbl
)
Run a query to Download Data