zakkisyedLuna price - last 6 months
    Updated 2022-04-13
    select days1, days2, prev_luna_price, ((100*(prev_luna_price - luna_price))/prev_luna_price) as percentage_change
    from
    (
    select t1.days1, t2.days2 as days2, luna_price, t2.prev_luna_price
    from
    (select
    date_trunc('day',DATE) as days1,
    avg(balance_usd/balance) as luna_price
    from terra.daily_balances
    where currency = 'LUNA'
    and balance != '0'
    and date > CURRENT_DATE - 180
    group by 1
    order by 1 DESC
    ) as t1

    INNER JOIN
    --terra.daily_balances
    (
    select
    date_trunc('day',DATE-1) as days2,
    avg(balance_usd/balance) as prev_luna_price
    --sum(balance) as ust_supply
    from terra.daily_balances
    where currency = 'LUNA'
    and balance != 0
    and date > CURRENT_DATE - 180
    group by 1
    order by 1 DESC
    ) as t2
    ON t1.days1 = t2.days2
    )
    Run a query to Download Data