KARTODEVM Chains Average Block Time Compare
    Updated 2023-09-16
    with temp AS (
    SELECT
    date_trunc('day', BLOCK_TIMESTAMP) AS time_,
    'Ethereum' AS chain,
    86400/COUNT(distinct BLOCK_NUMBER) AS avg_block_time
    FROM ethereum.core.fact_blocks
    WHERE BLOCK_TIMESTAMP >= DATE_TRUNC('day',CURRENT_DATE()) - interval '90 days'
    AND BLOCK_TIMESTAMP < DATE_TRUNC('day',CURRENT_DATE())
    GROUP BY 1

    UNION ALL

    SELECT
    date_trunc('day', BLOCK_TIMESTAMP) AS time_,
    'Arbitrum' AS chain,
    86400/COUNT(distinct BLOCK_NUMBER) AS avg_block_time
    FROM arbitrum.core.fact_blocks
    WHERE BLOCK_TIMESTAMP >= DATE_TRUNC('day',CURRENT_DATE()) - interval '90 days'
    AND BLOCK_TIMESTAMP < DATE_TRUNC('day',CURRENT_DATE())
    AND BLOCK_TIMESTAMP >= '2022-06-23'
    GROUP BY 1

    UNION ALL

    SELECT
    date_trunc('day', BLOCK_TIMESTAMP) AS time_,
    'Avalanche' AS chain,
    86400/COUNT(distinct BLOCK_NUMBER) AS avg_block_time
    FROM avalanche.core.fact_blocks
    WHERE BLOCK_TIMESTAMP >= DATE_TRUNC('day',CURRENT_DATE()) - interval '90 days'
    AND BLOCK_TIMESTAMP < DATE_TRUNC('day',CURRENT_DATE())
    GROUP BY 1

    UNION ALL


    Run a query to Download Data