select
(sum(gas_used/pow(10,9)) * avg(price))/(sum(amount_usd)/1000000)
from optimism.core.ez_eth_transfers t
inner join optimism.core.fact_transactions ft on t.tx_hash = ft.tx_hash
inner join ethereum.core.fact_hourly_token_prices p
on hour::date = ft.block_timestamp::date and hour(p.hour) = hour(ft.block_timestamp)
where ft.block_timestamp > CURRENT_DATE - 31
and status = 'SUCCESS'
and symbol = 'WETH'