cryptocatEth + Rollups Daily Transactions
    Updated 2023-05-19
    WITH optimism AS (
    SELECT block_timestamp::date AS Day, COUNT(block_timestamp::date) AS optimism_transactions
    FROM optimism.core.fact_transactions
    WHERE block_timestamp::date BETWEEN '2020-12-31' AND GETDATE()::date
    GROUP BY block_timestamp::date
    ORDER BY block_timestamp::date DESC),
    arbitrum AS (SELECT block_timestamp::date AS Day, COUNT(block_timestamp::date) AS arbitrum_transactions
    FROM arbitrum.core.fact_transactions
    WHERE block_timestamp::date BETWEEN '2020-12-31' AND GETDATE()::date
    GROUP BY block_timestamp::date
    ORDER BY block_timestamp::date DESC),

    eth AS (SELECT block_timestamp::date AS Day, COUNT(block_timestamp::date) AS eth_transactions
    FROM ethereum.core.fact_transactions
    WHERE block_timestamp::date BETWEEN '2020-12-31' AND GETDATE()::date
    GROUP BY block_timestamp::date
    ORDER BY block_timestamp::date DESC
    )

    SELECT eth.Day, eth_transactions, optimism.optimism_transactions, arbitrum.arbitrum_transactions, (IFNULL(eth.eth_transactions,0) + IFNULL(optimism.optimism_transactions,0) + IFNULL(arbitrum.arbitrum_transactions,0)) AS total_transactions
    FROM eth
    LEFT JOIN optimism ON eth.Day = optimism.Day
    LEFT JOIN arbitrum ON eth.Day = arbitrum.Day
    ORDER BY DAY ASC
    Run a query to Download Data