barbodDaily Total Swaps by Bots - Average Users
    Updated 2022-05-02
    with tab1 as (
    select
    trader as trader1,
    count(*)


    from terra.swaps
    where block_timestamp > current_date - 112
    group by 1
    order by 2 DESC
    limit 72 )

    , tabBot as (
    select
    date_trunc('day', block_timestamp) as date1,
    count(*) as BOT

    from terra.swaps
    where trader in (select trader1 from tab1) and block_timestamp > current_date - 30
    group by 1

    )

    ,tabAverage as (
    select
    date_trunc('day', block_timestamp) as date2,
    count(*) as Average_User


    from terra.swaps
    where trader not in (select trader1 from tab1) and block_timestamp > current_date - 30
    group by 1
    )

    select
    date1,
    Run a query to Download Data