Pmisha-bmlMdxUser identification
    Updated 2022-04-27
    with t1 as(with users as(select
    date_trunc('minute',block_timestamp) as min,
    TX_FROM[0] as or_users,
    count (tx_id) as no_transaction
    from terra.transactions
    where block_timestamp::date >= current_date - 60
    group by 1, 2
    having no_transaction < 20)

    select 'Average users' as user_type,
    count(distinct or_users) as total_users
    from users),

    t2 as ( with bots as(select
    date_trunc('minute',block_timestamp) as min,
    TX_FROM[0] as bot_users,
    count (tx_id) as no_transaction
    from terra.transactions
    where block_timestamp::date >= current_date - 60
    group by 1, 2
    having no_transaction >= 20)

    select 'BOTS' as user_type,
    count(distinct bot_users) as total_users
    from bots)

    select * from t1 union all select * from t2
    Run a query to Download Data