0-MIDAverage daily Swap Volume (USD) over the past week
    Updated 2022-10-12
    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
    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
    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_FROM,AVG_SWAP_TO
    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 date>=current_date-7
    and SYMBOL='AKT'
    group by 1)
    select act2.date,AVG_SWAP_FROM*akt_price as swap_from_usd,AVG_SWAP_TO*akt_price as swap_to_usd
    from act1
    left join act2
    on act1.date=act2.date
    group by 1,2,3

    Run a query to Download Data