Updated 2022-11-26
    with headfirst as (select trader , from_currency , sum(from_amount/pow(10,from_decimal)) as total_amount
    from osmosis.core.fact_swaps
    where to_currency is null
    group by trader , from_currency)
    , pairs as (select trader , from_currency , sum(from_amount/pow(10,from_decimal)) as total_amount
    from osmosis.core.fact_swaps
    where to_currency is not null
    group by trader , from_currency)

    , dim_labels as (select address, project_name as name from osmosis.core.dim_labels)

    , dim_prices as (select symbol,avg(price) as usd from osmosis.core.dim_prices
    group by symbol)


    select avg(total_amount) as avg_amount , avg(total_amount*usd) as avg_usd , symbol from headfirst inner join dim_labels on from_currency=address
    inner join dim_prices on symbol=name
    group by symbol
    Run a query to Download Data