zakkisyedUpdate query for LUNA vs UST
Updated 2022-07-07
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
›
⌄
select t1.days1, luna_price, ust_supply
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 - 90
group by 1
order by 1 DESC
) as t1
INNER JOIN
--terra.daily_balances
(
select
date_trunc('day',DATE) as days2,
sum(balance) as ust_supply
from terra.daily_balances
where currency = 'UST'
and date > CURRENT_DATE - 90
group by 1
order by 1 DESC
) as t2
ON t1.days1 = t2.days2
Run a query to Download Data