DrsimonUntitled Query
    Updated 2022-07-26
    with block_time as ((
    select block_timestamp
    , lag(block_timestamp,1) over(order by block_timestamp) as block_timestamp_lag
    , timediff(second, block_timestamp_lag, block_timestamp) as block_timediff
    from polygon.core.fact_blocks
    order by block_timestamp
    )
    select date_trunc("MONTH", block_timestamp) as month
    , avg(block_timediff) as average_blocktime
    from block_time
    group by 1
    order by 1 ) , with block_size as (
    select t.block_id
    , b.block_timestamp
    , count(t.tx_id) over (partition by t.block_id) as block_count
    from polygon.core.fact_blocks as t
    join algorand.block as b
    on b.block_id = t.block_id
    )

    select date_trunc("MONTH", block_timestamp) as day
    , avg(block_count) as block_count
    from block_size
    group by 1
    order by 1 asc




    Run a query to Download Data