CoinConverseSwap Fees swpping to osmo rank
    Updated 2022-06-28
    with tx_swap_from as (select tx_id, from_currency, to_currency, label
    from osmosis.core.fact_swaps swap
    inner join osmosis.core.dim_labels lab on
    swap.from_currency = lab.address
    where tx_status = 'SUCCEEDED' and to_currency like '%uosmo%')
    (select label as token, avg(REGEXP_INSTR(FEE, '[^0-9]') / 1e6) as avg_swap_fee, 'highest swap fee' as fee_status
    from osmosis.core.fact_transactions txs
    inner join tx_swap_from swap on
    swap.tx_id = txs.tx_id
    group by 1
    order by avg_swap_fee desc
    limit 1)
    union all
    (select label as token, avg(REGEXP_INSTR(FEE, '[^0-9]') / 1e6) as avg_swap_fee, 'lowest swap fee' as fee_status
    from osmosis.core.fact_transactions txs
    inner join tx_swap_from swap on
    swap.tx_id = txs.tx_id
    group by 1
    order by avg_swap_fee asc
    limit 1)
    Run a query to Download Data