Mrftigood-indigo copy
    Updated 2 hours ago
    -- forked from good-indigo @ https://flipsidecrypto.xyz/studio/queries/9456a8bb-7c57-4c4f-9796-a8908ac7afc0

    WITH block_data AS (
    SELECT
    block_timestamp,
    count(DISTINCT tx_hash) as tx_count,
    LEAD(block_timestamp) OVER (ORDER BY block_timestamp) as next_block_timestamp
    FROM
    swell.core.fact_transactions
    GROUP BY
    block_timestamp
    )

    SELECT
    AVG(tx_count / NULLIF(DATEDIFF('second', block_timestamp, next_block_timestamp), 0)) AS "AVG TPS",
    MAX(tx_count / NULLIF(DATEDIFF('second', block_timestamp, next_block_timestamp), 0)) AS "MAX TPS"
    FROM
    block_data
    WHERE
    next_block_timestamp IS NOT NULL


    Last run: about 2 hours agoAuto-refreshes every 12 hours
    AVG TPS
    MAX TPS
    1
    0.54874225181211.5
    1
    23B
    4s