with tx_ides as (select tx_hash,contract_address from ethereum.core.fact_event_logs
where contract_name='KashiPairMediumRiskV1')
select sum(tx_fee),contract_address from ethereum.core.fact_transactions inner join tx_ides
on tx_ides.tx_hash=ethereum.core.fact_transactions.tx_hash
group by 2
order by 1 desc