KaskoazulBots in Flow
    Updated 2022-06-09
    with txs as (
    select block_timestamp as fecha,
    tx_id,
    proposer as wallet,
    tx_succeeded as success
    from flow.core.fact_transactions
    where fecha >= '2022-05-01'
    ),
    daily_count as (
    select fecha::date as dia,
    wallet,
    count (distinct tx_id) as daily_txs
    from txs
    group by 1,2
    order by 3 desc
    ),

    max_number as (
    select wallet,
    max (daily_txs) as max_txs
    from daily_count
    group by 1
    ),

    BOT_TXS as (
    select txs.fecha::date as dia,
    count (txs.tx_id) as bot_txs
    from txs
    inner join max_number
    on txs.wallet = max_number.wallet
    where max_number.max_txs > {{max_txs_human}}
    group by 1
    ),

    BOT_FAILED_TXS as (
    Run a query to Download Data