rezarwzAverage TPS
    Updated 2024-07-23
    sELECT
    BLOCK_TIMESTAMP :: date as date,
    'Arbitrum' as blockchain,
    count(HASH) as "Total Blocks",
    AVG(
    TIMEDIFF(SECOND, BLOCK_TIMESTAMP, NEXT_BLOCK_TIMESTAMP)
    ) AS "AVG Block Time",
    avg(
    TX_COUNT / NULLIF(TIMEDIFF(SECOND, BLOCK_TIMESTAMP, next_block_timestamp), 0)
    ) AS "AVG TPS",
    MAX(
    TX_COUNT / NULLIF(TIMEDIFF(SECOND, BLOCK_TIMESTAMP, next_block_timestamp), 0)
    ) AS "MAX TPS",
    AVG(tx_count) AS "AVG TPB",
    AVG((GAS_USED / GAS_LIMIT) * 100) AS "AVG % of Block Utilization"
    from
    (
    SELECT
    BLOCK_TIMESTAMP,
    HASH,
    TX_COUNT,
    GAS_USED,
    GAS_LIMIT,
    BLOCK_NUMBER,
    LEAD(BLOCK_TIMESTAMP) OVER (
    ORDER BY
    BLOCK_NUMBER
    ) AS NEXT_BLOCK_TIMESTAMP
    FROM
    Arbitrum.core.fact_blocks

    )
    group by
    1,
    2
    union all
    QueryRunArchived: QueryRun has been archived