dbrgBS-SC-Deployers-Distro-Deloyers
    Updated 2023-05-04
    with
    contract_creation_tx as (
    select
    tx_hash,
    block_timestamp,
    from_address as deployer,
    tx_json:receipt:contractAddress as contract,
    -- tx_json,
    tx_fee
    from
    base.goerli.fact_transactions
    where
    to_address is null
    and block_timestamp >= to_date('{{start_date}}')
    and block_timestamp <= add_months(
    to_date('{{start_date}}'),
    {{duration_in_months}}
    )
    and status = 'SUCCESS'
    -- limit 1
    -- and tx_json::string like '%Upgrade%'
    ),
    deployers_stats as (
    select
    deployer,
    min(block_timestamp) as first_deploy,
    count(tx_hash) as deploy_count,
    WIDTH_BUCKET(deploy_count, 1, 20,20 ) AS "Deployer GROUP",
    sum(tx_fee) as total_fee_eth,
    WIDTH_BUCKET(total_fee_eth, 1, 10, 10) AS "FEE GROUP"
    from
    contract_creation_tx
    group by
    1
    order by
    1
    Run a query to Download Data