Pmisha-bmlMdxLBP_from_STT_and_Farming_HALO_number_of_users
    Updated 2022-01-05
    with STT_HALO_IDO as ( select * from terra.msgs
    where msg_value:contract::string = 'terra1plwvxr0923thz8hzcccstvtj2qj8zxfzzren7m' --STT
    and tx_status ='SUCCEEDED' and msg_value:execute_msg::string like '%join_ido%' ),
    STT_HALO_IDO_participants as (
    select msg_value:sender::string as address_of_users
    from STT_HALO_IDO
    GROUP BY address_of_users
    ),
    HALO_LBP as ( select * from terra.msgs
    where msg_value:contract::string = 'terra1hhpgcp2stvzx952zfxtxg4dhgf60yfzchesj3e'
    and tx_status ='SUCCEEDED' ),
    HALO_LBP_participants as (
    select msg_value:sender::string as address_of_users
    from HALO_LBP
    GROUP BY address_of_users
    ),
    apollo_halo_farming as ( select * from terra.msgs
    where msg_value:contract::string = 'terra1leadedadm2fguezmd4e445h6fe337yzq8n2dxf'
    and tx_status ='SUCCEEDED' ),
    apollo_halo_farming_participants as (
    select msg_value:sender::string as address_of_users
    from apollo_halo_farming
    GROUP BY address_of_users
    ),
    participants_in_STT_and_HALOfarming as (
    select address_of_users
    from STT_HALO_IDO_participants
    UNION
    select address_of_users
    from apollo_halo_farming_participants
    )
    select count (address_of_users) from HALO_LBP_participants where address_of_users IN (select address_of_users from participants_in_STT_and_HALOfarming )
    Run a query to Download Data