with tab3 as (with tab1 as (select block_timestamp, tx_hash, origin_from_address
from blast.core.fact_event_logs
where origin_function_signature='0x183ff085'
and tx_status='SUCCESS'
and origin_to_address='0x5ff315aa82a8b2b435f866d20ecd46959999bdcd'),
tab2 as (select tx_hash, tx_fee
from blast.core.fact_transactions)
select block_timestamp, TAB1.tx_hash, origin_from_address, tx_fee
from tab1 left join tab2 on tab1.tx_hash=tab2.tx_hash)
select origin_from_address as "User", sum(tx_fee) as "Fee ($ETH)", max(tx_fee) as "Max ($ETH)", AVG(tx_fee) as "Avg ($ETH)", count(distinct tx_hash) as "Txn Count"
from tab3
group by 1
order by 2 desc
limit 5