Nige777746 Bonded vs unbonded luna price
Updated 2021-08-18
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
with cte_l as (
select
DISTINCT
date_trunc('DAY',block_timestamp) AS DAY,
AVG (Price_USD ) OVER (partition by date_trunc('DAY',block_timestamp) ORDER by date_trunc('DAY',block_timestamp) ) AS Luna_PRICE
from terra.oracle_prices p
where
block_timestamp >= CURRENT_DATE -180
and currency = 'uluna'
),
cte_b as (
select
DISTINCT
date_trunc('DAY',block_timestamp) AS DAY,
AVG (Price_USD ) OVER (partition by date_trunc('DAY',block_timestamp) ORDER by date_trunc('DAY',block_timestamp) ) AS UST_PRICE
from terra.oracle_prices p
where
block_timestamp >= CURRENT_DATE -180
and symbol = 'UST'
)
select l.day , luna_price, ust_price
from cte_l l
inner join cte_b b on b.day = l.day
Run a query to Download Data