saber-jlLUNA vs SOL price on january 9
Updated 2023-01-18Copy Reference Fork
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
›
⌄
with SOL as(
select
trunc(hour, 'hour') as sdate,
avg(price) as "sol price"
from ethereum.core.fact_hourly_token_prices
where token_address = lower('0xD31a59c85aE9D8edEFeC411D448f90841571b89c')
and sdate >= '2023-01-09'
group by 1
order by 1
limit 24),
luna as (
select
date_trunc('hour',BLOCK_TIMESTAMP) as date,
avg(to_amount/from_amount) as "luna price"
from terra.core.ez_swaps
where FROM_CURRENCY = 'uluna'
and TO_CURRENCY = 'ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4'
and date >= '2023-01-09'
and TX_SUCCEEDED = 'TRUE'
group by 1
order by 1
limit 24)
select date , "sol price" , "luna price"
from luna join sol on luna.date = sol.sdate
group by 1,2,3
Run a query to Download Data