boomer77Prices 2021
Updated 2021-12-11
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
›
⌄
with other as (select hour, price, symbol
from ethereum.token_prices_hourly
where symbol in ('THOR', 'XRUNE', 'RUNE') and hour > '2021-11-06'),
rune as (select hour, avg(price) over (order by hour rows between 29 preceding and current row) as price, 'RUNE_MA_30' as symbol
from ethereum.token_prices_hourly
where symbol = 'RUNE' and hour > '2021-11-06'),
final as (select * from other
union
select * from rune
order by 1 asc),
xrune as (select * from final
where symbol = 'XRUNE'),
RUNEs as (select * from final
where symbol = 'RUNE'),
THOR as (select * from final
where symbol = 'THOR'),
MA_30 as (select * from final
where symbol = 'RUNE_MA_30')
select a.hour, a.price as xrune, b.price as RUNE, c.price as THOR, d.price as MA_30
from xrune a
left join runes b on a.hour = b.hour
left join thor c on a.hour = c.hour
left join MA_30 d on a.hour = d.hour
order by 1 asc