0xallyzacharb users
    Updated 2023-06-15
    SELECT chain, transaction_date, SUM(distinct_from_addresses) AS total_distinct_from_addresses
    FROM (
    SELECT 'arbitrum' AS chain, DATE_TRUNC('week', TO_TIMESTAMP(block_timestamp)) AS transaction_date,
    COUNT(DISTINCT from_address) AS distinct_from_addresses
    FROM arbitrum.core.fact_transactions
    WHERE TO_TIMESTAMP(block_timestamp) >= '2022-01-01'
    GROUP BY transaction_date

    UNION ALL

    SELECT 'optimism' AS chain, DATE_TRUNC('week', TO_TIMESTAMP(block_timestamp)) AS transaction_date,
    COUNT(DISTINCT from_address) AS distinct_from_addresses
    FROM optimism.core.fact_transactions
    WHERE TO_TIMESTAMP(block_timestamp) >= '2022-01-01'
    GROUP BY transaction_date

    UNION ALL

    SELECT 'ethereum' AS chain, DATE_TRUNC('week', TO_TIMESTAMP(block_timestamp)) AS transaction_date,
    COUNT(DISTINCT from_address) AS distinct_from_addresses
    FROM ethereum.core.fact_transactions
    WHERE TO_TIMESTAMP(block_timestamp) >= '2022-01-01'
    GROUP BY transaction_date
    ) subquery
    GROUP BY chain, transaction_date
    ORDER BY transaction_date;

    Run a query to Download Data