boomer77Prices 2021
    Updated 2021-12-11
    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