dbrgBS-Min_Total_Avg_Median
    Updated 2023-05-10
    -- forked from 09fe99e9-1ab0-4b22-8d7c-275b0c51e1a4
    with
    contract_creation_tx as (
    select
    tx_hash,
    block_timestamp,
    from_address as deployer,
    tx_json:receipt:contractAddress as contract,
    tx_fee
    from
    base.goerli.fact_transactions
    where
    to_address is null
    -- and block_timestamp >= to_date('{{start_date}}')
    and block_timestamp >= to_date('{{start_date}}')
    and block_timestamp <= add_months(
    to_date('{{start_date}}'),
    {{duration_in_months}}
    )
    and status = 'SUCCESS'
    )
    select
    -- tx_fee,
    count(*) as contract_counts,
    sum(tx_fee) as total_fee_eth,
    min(tx_fee) as min_fee_eth,
    max(tx_fee) as max_fee_eth,
    avg(tx_fee) as avg_fee_eth,
    median(tx_fee) as median_fee_eth,
    count(distinct deployer) as deployers
    from
    contract_creation_tx as tx
    Run a query to Download Data