HosseinUntitled Query
Updated 2022-11-24
999
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
36
›
⌄
with t1 as (
select
avg(price) price_current_eth
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH'
and hour::date = (select max(hour::date) from ethereum.core.fact_hourly_token_prices where symbol = 'WETH')
),
daily_price_eth as (
select
date_trunc('day', hour)::date as date,
symbol,
avg(price) price_eth,
((price_eth - price_current_eth) / price_current_eth) * 100 as change_percent_eth
from ethereum.core.fact_hourly_token_prices
join t1
where symbol = 'WETH'
and hour::date >= '2022-11-01'
group by 1, 2, price_current_eth
),
t2 as (
select
avg(close) price_current_sol
from solana.core.fact_token_prices_hourly
where symbol = 'SOL'
and recorded_hour::date = (select max(recorded_hour::date) from solana.core.fact_token_prices_hourly where symbol = 'SOL')
),
daily_price_sol as (
select
date_trunc('day', recorded_hour)::date as date,
symbol,
avg(close) as price_sol,
((price_sol - price_current_sol) / price_current_sol) * 100 as change_percent_sol
from solana.core.fact_token_prices_hourly
Run a query to Download Data