select avg(close) * sum(fee/1e9) / count(distinct block_id) as Average_block , hour(block_timestamp)
from solana.core.fact_token_prices_hourly inner join solana.core.fact_transactions
on recorded_hour::date=block_timestamp::date
where
symbol='SOL'
and recorded_hour::date > current_date - interval '30 days'
and block_timestamp::date > current_date - interval '30 days'
group by 2