select
count(distinct(tx_id)) as tx_num,
avg(close) as avg_price,
avg_price * sum(fee/ pow (10, 9)) as total_amount,
(total_amount / tx_num) as avg_amount_per_txn
from solana.core.fact_token_prices_hourly
join solana.core.fact_transactions
on block_timestamp::date = recorded_hour::date
where 1 = 1
and block_timestamp::date > '2022-10-01'
and symbol = 'SOL'