dbrgBS-SC-Distro-Fees copy
    Updated 2023-05-05
    with
    contract_creation_tx as (
    select
    tx_hash,
    block_timestamp,
    from_address as deployer,
    tx_json:receipt:contractAddress as contract,
    -- tx_json,
    tx_fee,
    WIDTH_BUCKET(tx_fee, 0, 0.1, 10) AS "FEE GROUP"
    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'
    )
    select
    "FEE GROUP" * 0.01 as "FEE GROUP",
    count(*) as "Group Count"
    from
    contract_creation_tx
    group by
    1
    order by
    1



    Run a query to Download Data