0xHaM-dNew Deployed Contracts
    Updated 2023-01-19
    with deployDate as (
    SELECT
    min(block_timestamp) as deployed_date,
    'Optimism' as chain,
    contract_address
    FROM optimism.core.fact_event_logs
    GROUP by 2,3

    UNION
    SELECT
    min(block_timestamp) as deployed_date,
    'Arbitrum' as chain,
    contract_address
    FROM arbitrum.core.fact_event_logs
    GROUP by 2,3

    UNION
    SELECT
    min(block_timestamp) as deployed_date,
    'Ehtereum' as chain,
    contract_address
    FROM ethereum.core.fact_event_logs
    GROUP by 2,3
    )
    SELECT
    date_trunc('{{timespan}}',deployed_date)::date as date,
    chain,
    COUNT(DISTINCT contract_address) as "Contract Count",
    sum("Contract Count") over (partition by chain order by date) as "Cumulative Contract Count"
    FROM deployDate
    WHERE date >= CURRENT_DATE - INTERVAL '{{Past_Months}} MONTH'
    AND date <= CURRENT_DATE - 1
    GROUP by 1,2
    ORDER by 1
    Run a query to Download Data