Elprognerd4 contracts with the most of the average tx fee per txn
    Updated 2023-03-27
    select
    name as "Contract",
    count (distinct x.tx_hash) as "Number of txns",
    sum(tx_fee) as "Total fees",
    avg(tx_fee) as "Average fee per txn"
    from avalanche.core.fact_transactions x join avalanche.core.fact_event_logs y on x.tx_hash = y.tx_hash
    join avalanche.core.dim_contracts z on y.contract_address = z.address
    where x.block_timestamp >= '{{From_Date}}'
    and x.block_timestamp <= '{{To_Date}}'

    GROUP BY 1
    ORDER BY 4 DESC
    LIMIT 10


    Run a query to Download Data