Abbas_ra21Layer 2: transactions Volume #4
    Updated 2023-02-04
    WITH transactions AS (
    SELECT
    'Optimism' AS Chain,
    DATE_TRUNC('day', BLOCK_TIMESTAMP) as day,
    COUNT(*) as transactions
    FROM optimism.core.fact_transactions
    where BLOCK_TIMESTAMP::Date between dateadd('month',-6,'2023-01-29') and '2023-01-29'
    GROUP BY day
    union ALL
    SELECT
    'Arbitrum' AS Chain,
    DATE_TRUNC('day', BLOCK_TIMESTAMP) as day,
    COUNT(*) as transactions
    FROM arbitrum.core.fact_transactions
    where BLOCK_TIMESTAMP::Date between dateadd('month',-6,'2023-01-29') and '2023-01-29'
    GROUP BY day
    union ALL
    SELECT
    'Polygon' AS Chain,
    DATE_TRUNC('day', BLOCK_TIMESTAMP) as day,
    COUNT(*) as transactions
    FROM polygon.core.fact_transactions
    where BLOCK_TIMESTAMP::Date between dateadd('month',-6,'2023-01-29') and '2023-01-29'
    GROUP BY day
    )
    SELECT
    day,
    chain,
    transactions/86400 AS TPS
    FROM transactions
    ORDER BY day
    Run a query to Download Data