0-MIDTotal average daily Swap Volume (USD) over the past week
    Updated 2023-04-14
    with act1 as (
    with tab1 as (
    select BLOCK_TIMESTAMP::date as date,sum(FROM_AMOUNT)/1e6 as "SWAP FROM AKT",avg(FROM_AMOUNT)/1e6as "AVG SWAP FROM AKT"
    from osmosis.core.fact_swaps
    where FROM_CURRENCY='ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4'
    and date>=current_date-7
    group by 1),
    tab2 as (
    select BLOCK_TIMESTAMP::date as date,sum(TO_AMOUNT)/1e6 as "SWAP TO AKT",avg(TO_AMOUNT)/1e6as "AVG SWAP TO AKT"
    from osmosis.core.fact_swaps
    where TO_CURRENCY='ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4'
    and date>=current_date-7
    group by 1)
    select tab2.date,"SWAP FROM AKT","SWAP TO AKT","AVG SWAP TO AKT","AVG SWAP FROM AKT"
    from tab1
    left join tab2
    on tab1.date=tab2.date
    group by 1,2,3,4,5),
    act2 as (
    select RECORDED_AT::date as date,avg(PRICE)as akt_price
    from osmosis.core.dim_prices
    where SYMBOL='AKT'
    and date>=current_date-7
    group by 1)
    select act2.date,"SWAP FROM AKT"*akt_price as total_price_from
    ,sum("SWAP FROM AKT")over(order by act2.date)as "TOTAL SWAP FROM AKT"
    ,avg(total_price_from)over(order by act2.date)as TOTAL_AVG_SWAP_FROM
    ,"SWAP TO AKT"*akt_price as total_price_to
    ,sum("SWAP TO AKT")over(order by act2.date)as "TOTAL SWAP TO AKT"
    ,avg(total_price_to)over(order by act2.date)as TOTAL_AVG_SWAP_TO
    ,"AVG SWAP TO AKT"*akt_price as "AVG SWAP TO AKT"
    ,"AVG SWAP FROM AKT"*akt_price as "AVG SWAP FROM AKT"
    from act1
    full outer join act2
    on act1.date=act2.date

    Run a query to Download Data