snowmanUntitled Query
Updated 2022-11-15Copy 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
›
⌄
with roo as (
select date_trunc('hour', recorded_hour)
as hour,
avg(close)
as price
from solana.core.fact_token_prices_hourly
--from solana.core.fact_token_prices_hourly
where symbol = 'SOL'
and recorded_hour::date >=
current_date - 30
group by 1
)
select date_trunc('day', block_timestamp)
as date,
sum(price*fee/pow(10,9))
as "Fee",
avg(price)
as "solana"
from solana.core.fact_transactions
inner join roo
on date_trunc('hour', block_timestamp) =
hour
and block_timestamp::date >=
current_date - 30
group by 1
Run a query to Download Data