arctic-night-foxaverage time between blocks on Polygon
    Updated 2022-07-27
    WITH Base AS (
    SELECT
    DATEDIFF(SECOND, LAG(BLOCK_TIMESTAMP) OVER (ORDER BY BLOCK_TIMESTAMP), BLOCK_TIMESTAMP ) AS difference_time
    FROM
    polygon.core.fact_blocks
    WHERE BLOCK_TIMESTAMP::DATE >= '2022-01-01'
    AND NETWORK = 'mainnet'
    ORDER BY BLOCK_NUMBER)


    SELECT
    AVG(difference_time) AS average_time
    FROM
    Base
    Run a query to Download Data