SalehBot Activity-compare
    Updated 2022-05-16
    with lst_bots as (
    select
    from_address as bot
    ,(select count(DISTINCT block_timestamp::date) from thorchain.swaps where from_address=s.from_address) as day_count
    ,count(TX_ID)/day_count as TPD
    from thorchain.swaps s
    group by 1
    having TPD>=50
    order by TPD DESC
    )
    ,bots as (
    select
    block_timestamp::date as day
    -- ,pool_name
    ,count(tx_id) as tx_count
    ,sum(FROM_AMOUNT_USD) as amount_usd
    ,sum(amount_usd) over (order by day) as amount_growth
    from thorchain.swaps
    where from_address in(select bot from lst_bots)
    group by 1
    order by 1
    )
    ,Non_bots as (
    select
    block_timestamp::date as day
    -- ,pool_name
    ,count(tx_id) as tx_count
    ,sum(FROM_AMOUNT_USD) as amount_usd
    ,sum(amount_usd) over (order by day) as amount_growth
    from thorchain.swaps
    where from_address not in(select bot from lst_bots)
    group by 1
    order by 1
    )
    select 'Bot' as Type ,* from bots
    union all
    Run a query to Download Data