Updated 2022-12-03
    with swap_action as (select date_trunc( 'week',block_timestamp) as week, tx_id, trader as users, 'Swapping' as action_type
    from osmosis.core.fact_swaps
    where tx_status = 'SUCCEEDED'
    and from_currency = 'ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'),
    LP_action as (select date_trunc( 'week',block_timestamp) as week, tx_id,
    liquidity_provider_address as users, 'Liquidity Providing' as type
    from osmosis.core.fact_liquidity_provider_actions
    where tx_status = 'SUCCEEDED'
    and currency = 'ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'),
    transfer_action_1 as (select date_trunc( 'week',block_timestamp) as week, tx_id,
    sender as users, 'Transfer Within Osmosis' as type
    from osmosis.core.fact_transfers
    where tx_status = 'SUCCEEDED' and transfer_type ilike 'OSMOSIS'
    and currency = 'ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'),
    transfer_action_2 as (select date_trunc( 'week',block_timestamp) as week, tx_id,
    sender as users, 'Bridge to other places' as type
    from osmosis.core.fact_transfers
    where tx_status = 'SUCCEEDED' and transfer_type ilike 'IBC_TRANSFER_OUT'
    and currency = 'ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E')
    select week, type,
    count (distinct tx_id) as count_transactions,
    count (distinct users) as count_users
    from (select * from LP_action union all select * from swap_action union all select * from transfer_action_1 union all select * from transfer_action_2)
    group by 1,2











    Run a query to Download Data