select
count(distinct(tx_id)) as tx_num,
avg(price_usd) as avg_price,
avg_price * sum(gas_limit / pow(10, 9)) as total_amount,
(total_amount / tx_num) as avg_amount_per_txn
from flow.core.fact_prices
join flow.core.fact_transactions
on block_timestamp::date = timestamp::date
where 1 = 1
and block_timestamp::date > '2022-10-01'
and token_contract = 'A.1654653399040a61.FlowToken'