select
DISTINCT FROM_CURRENCY as tokens_code_f ,
COUNT(*) AS number_of_tokens_swaped,
sum(fees) as amount_of_fee,
amount_of_fee/number_of_tokens_swaped AS fee_per_token
from
(select
fact_swaps.*,
replace(fee,'uosmo','') as fees
from osmosis.core.fact_swaps
inner join osmosis.core.fact_transactions on fact_transactions.tx_id=fact_swaps.tx_id
where fee ilike '%uosmo%'
and fact_transactions.tx_status= 'SUCCEEDED'
and fee !='0uosmo')
group by 1
order by 4 DESC
limit 100