kiacryptoDaily average OSMO tx count, unique swapper and volume
    Updated 2022-11-03
    with price as (
    select
    date_trunc('day', recorded_at) as day,
    avg(price) as price
    from osmosis.core.dim_prices
    where symbol = 'OSMO'
    group by 1
    ),
    base as (
    select
    price * (from_amount/pow(10,from_decimal)) as volume, *
    from osmosis.core.fact_swaps f join price on day = block_timestamp::date
    where
    block_timestamp::date >= '2022-03-07' and
    tx_status = 'SUCCEEDED' and
    from_currency = 'uosmo'

    union all

    select
    price * (to_amount/pow(10,to_decimal)) as volume, *
    from osmosis.core.fact_swaps f join price on day = block_timestamp::date
    where
    block_timestamp::date >= '2022-03-07' and
    tx_status = 'SUCCEEDED' and
    to_currency = 'uosmo'
    ),
    daily_metrics as (
    select
    date_trunc('day', block_timestamp) as date,
    case
    when date between '2022-03-07' and '2022-05-07' then '60 days before Terra collapse'
    when date between '2022-08-28' and '2022-10-27' then '60 days before listing on Binance'
    when date = '2022-10-28' then 'listing on Binance'
    when date > '2022-10-28' then 'after listing on Binance'
    else 'others' end as dis,
    Run a query to Download Data