zakkisyedLuna price - last 6 months
Updated 2022-04-13
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
›
⌄
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