kiacryptoswap activity
    Updated 2022-10-13
    with from_dot as (
    select
    date_trunc('day', block_timestamp) as date,
    count(distinct tx_id) as from_tx_count,
    count(distinct trader) as from_unique_swapper,
    sum(from_amount/1e10) as from_tx_volume,
    avg(from_tx_count) over (order by date, date rows between 6 preceding and current row) as ma7_from_tx_count,
    avg(from_unique_swapper) over (order by date, date rows between 6 preceding and current row) as ma7_from_unique_user,
    avg(from_tx_volume) over (order by date, date rows between 6 preceding and current row) as ma7_from_tx_volume,

    sum(from_tx_count) over (order by date) as cum_from_tx_count,
    sum(from_tx_volume) over (order by date) as cum_from_tx_volume
    from osmosis.core.fact_swaps left join osmosis.core.dim_labels on from_currency = address
    where
    block_timestamp::date >= '2022-09-26' and
    from_currency = 'ibc/3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7' and
    tx_status = 'SUCCEEDED' and
    project_name = 'DOT.axl'
    group by 1
    ),
    to_dot as (
    select
    date_trunc('day', block_timestamp) as date,
    count(distinct tx_id) as to_tx_count,
    count(distinct trader) as to_unique_swapper,
    sum(to_amount/1e10) as to_tx_volume,
    avg(to_tx_count) over (order by date, date rows between 6 preceding and current row) as ma7_to_tx_count,
    avg(to_unique_swapper) over (order by date, date rows between 6 preceding and current row) as ma7_to_unique_user,
    avg(to_tx_volume) over (order by date, date rows between 6 preceding and current row) as ma7_to_tx_volume,

    sum(to_tx_count) over (order by date) as cum_to_tx_count,
    sum(to_tx_volume) over (order by date) as cum_to_tx_volume
    from osmosis.core.fact_swaps left join osmosis.core.dim_labels on to_currency = address
    where
    Run a query to Download Data