Ali3NDaily $LUNA Price Over Time Since 2023
    Updated 2023-01-12
    with maintable as (
    select date_trunc (day,block_timestamp) as date,
    median (to_amount/from_amount) as LUNA_Price,
    avg (LUNA_Price) over (order by date rows between 6 preceding and current row) as Moving_Average_7,
    avg (LUNA_Price) over (order by date rows between 29 preceding and current row) as Moving_Average_30,
    avg (LUNA_Price) over (order by date rows between 59 preceding and current row) as Moving_Average_60,
    avg (LUNA_Price) over (order by date rows between 199 preceding and current row) as Moving_Average_200
    from terra.core.ez_swaps
    where from_currency = 'uluna'
    and to_currency = 'ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4'
    and to_amount < 1e8 and from_amount < 1e8
    group by 1 )

    select * from maintable
    where date >= '2023-01-01'
    Run a query to Download Data