PeimanBots success and Failed transactions
    Updated 2022-07-07
    with bots AS (select date_trunc('minute',block_timestamp) time,TRADER
    from terra.swaps
    where block_timestamp >= current_date-60
    group by time,trader
    having count(*)>5
    ),
    transactionha as ( select
    TX_FROM[0] as tx,
    count(case when TX_STATUS = 'SUCCEEDED' then 1 end) as success,
    count(case when TX_STATUS = 'FAILED' then 1 end) as failed
    from terra.transactions
    where block_timestamp >= current_date-60
    group by tx
    )
    select
    DISTINCT b.TRADER,
    t.success,
    t.failed
    from transactionha t INNER join bots b on b.TRADER = t.tx

    Run a query to Download Data