Hadisehuns 5
    Updated 2022-07-20
    with tb as (select trunc(block_timestamp,'week') as date , tx_from
    from osmosis.core.fact_transactions
    where tx_id in ( select tx_id from osmosis.core.fact_msg_attributes
    where msg_type = 'unbond' and attribute_key = 'amount')
    )

    select trunc(block_timestamp,'week') as date_ , 'swap' as status , count(DISTINCT(tx_id)) as total
    from osmosis.core.fact_swaps a join tb b on a.TRADER = b.tx_from
    where trunc(block_timestamp,'week') > date and TX_STATUS = 'SUCCEEDED' and from_currency = 'uosmo'
    group by 1,2
    UNION
    select trunc(block_timestamp,'week') as date_ , 're-delegate' as status , count(DISTINCT(tx_id)) as total
    from osmosis.core.fact_staking a join tb b on a.TX_CALLER_ADDRESS = b.tx_from
    where action = 'delegate' and CURRENCY = 'uosmo' and TX_STATUS = 'SUCCEEDED'
    and trunc(block_timestamp,'week') > date
    group by 1,2
    UNION
    select trunc(block_timestamp,'week') as date_ , 'LP_position' as status ,count(DISTINCT(tx_id)) as count
    from osmosis.core.fact_liquidity_provider_actions a join tb b on a.LIQUIDITY_PROVIDER_ADDRESS = b.tx_from
    where trunc(block_timestamp,'week') > date and currency = 'uosmo' and action = 'pool_joined'
    group by 1,2

    Run a query to Download Data