KaskoazulBots and success rate - FAILED msgtype
    Updated 2022-04-25

    with daily_count as (
    select date_trunc ('day', block_timestamp) as fecha,
    count(distinct tx_id) as interactions,
    tx_from as users
    from terra.transactions
    where fecha >= CURRENT_DATE - 60
    and fecha < CURRENT_DATE - 1
    group by fecha, users
    order by interactions desc
    ),

    max_number as (
    select users,
    max (interactions) as max_interactions
    from daily_count
    where users is not NULL
    group by users
    ),

    BASE as (
    select t.block_timestamp::date as fecha,
    t.tx_status_msg,
    t.gas_used,
    t.gas_wanted,
    t.gas_used / t.gas_wanted as gas_ratio,
    m.msg_type,
    t.tx_id,
    case
    when n.max_interactions > 25 then 'BOT'
    else 'CARBON-BASED'
    end as type
    from terra.transactions t
    inner join max_number n
    on t.tx_from = n.users
    Run a query to Download Data