John_GaltCRO/OSMO: Activity
    Updated 2023-04-18
    with poolfilter as (select
    distinct tx_id
    from osmosis.core.fact_msg_attributes
    where date(block_timestamp) > DATEADD(month, -3, current_date)
    and msg_type = 'token_swapped'
    and attribute_key = 'pool_id'
    and attribute_value = 9
    ),

    addfilter as (select
    date(block_timestamp) as date,
    SPLIT_PART(attribute_value, '/', 1) as address,
    o.tx_id
    from osmosis.core.fact_msg_attributes as o
    inner join poolfilter on o.tx_id = poolfilter.tx_id
    where date(block_timestamp) > DATEADD(month, -3, current_date)
    and msg_type = 'tx'
    and attribute_key = 'acc_seq'
    ),

    final1 as (select
    date, count(address) as total_swaps, COUNT(DISTINCT address) as unique_addr
    from addfilter
    where date < current_date
    group by date
    order by date
    )

    select * from final1
    Run a query to Download Data