Moeavax swap os
    Updated 2023-02-08
    with prices as (
    select
    date(HOUR) days ,
    avg(price) price
    from
    ethereum.core.fact_hourly_token_prices
    where SYMBOL ilike 'wavax'
    group by 1
    )

    ,fin as (select
    x.*,FROM_AMOUNT/1e18 * price as usd_amount

    from
    osmosis.core.fact_swaps x, prices p
    where
    block_timestamp::date = days
    and
    FROM_CURRENCY ilike'ibc/6F62F01D913E3FFE472A38C78235B8F021B511BC6596ADFF02615C8F83D3B373' )

    select
    date_trunc('day', block_timestamp) as date,
    count( distinct tx_id) as swaps ,
    --sum(swaps)over(partition by act order by date rows between unbounded preceding and current row ) as cumulative_swaps,
    count( distinct TRADER) as swapper ,
    --sum(userss)over(partition by act order by date rows between unbounded preceding and current row ) as cumulative_userss
    sum(usd_amount) as swap_amount,
    avg(usd_amount) as avg_amount
    from fin , osmosis.core.dim_labels
    where address = to_currency
    group by 1 order by 2 desc



    Run a query to Download Data