adriaparcerisassolana vs polygon 6
    Updated 2022-12-13

    WITH
    poly_bots as (
    Select
    from_address as unique_users,
    count(distinct tx_hash) as n_transactions,
    datediff('day',CURRENT_DATE-INTERVAL '{{period}}',CURRENT_DATE) as days,
    n_transactions/days as txs_day -- 192 are the current days of the year completed
    From polygon.core.fact_transactions
    Where block_timestamp>=CURRENT_DATE-INTERVAL '{{period}}'
    group by 1
    having txs_day>100
    ),
    final_poly_bots as (
    Select
    distinct from_address as bot,
    block_timestamp,
    tx_hash
    From polygon.core.fact_transactions
    Where block_timestamp>=CURRENT_DATE-INTERVAL '{{period}}' and from_address in (
    select unique_users from poly_bots)
    order by 1 ASC
    ),
    poly as (
    SELECT
    trunc(block_timestamp,'{{granularity}}') as date,
    count(distinct bot) as bots,
    count(distinct tx_hash) as txs_by_bots
    from final_poly_bots where block_timestamp>=CURRENT_DATE-INTERVAL '{{period}}'
    group by 1
    order by 1 asc
    ),
    sol_bots as (
    Select
    signers[0] as unique_users,
    count(1) as n_transactions,
    Run a query to Download Data