Updated 2022-09-28
    with tb1 as (
    select
    'LP provider' as type,
    LIQUIDITY_PROVIDER_ADDRESS as sender,
    count(tx_id) as no_transaction
    from osmosis.core.fact_liquidity_provider_actions
    where POOL_ID='812'
    and action in ('pool_joined')
    and TX_STATUS='SUCCEEDED'
    group by 1,2
    union all
    select
    'Swapper' as type,
    trader as sender,
    count(tx_id) as no_transaction
    from osmosis.core.fact_swaps
    where(POOL_IDS[0]=812 or POOL_IDS[1]=812) and TX_STATUS='SUCCEEDED'
    group by 1,2
    )


    select
    type,
    case
    when no_transaction=1 then 'One time users'
    when no_transaction>1 then 'More than 1 transaction'
    end as buckets,
    count(distinct sender) as count_users
    from tb1
    group by 1,2
    Run a query to Download Data