Skip to main content

Average Transaction Fee

Average Transaction Fee is the mean fee charged across all fee-bearing transactions on Hedera during the period, in tinybars.

Hedera Data Access

To access this Hedera network statistic (and others) via Hgraph's GraphQL & REST APIs, create a free account at app.hgraph.com.

Hedera Stat Name: avg_network_fee

Methodology​

Qualifying Transactions​

A transaction contributes to the average when both of the following hold:

  • Fee Bearing: charged_tx_fee > 0. Zero-fee transactions are excluded rather than counted as zeroes, so the figure reflects the typical cost of a transaction that actually cost something. Including them would drag the mean toward zero in proportion to free traffic.
  • Consensus Timestamp Range: consensus_timestamp falls within the requested start_timestamp and end_timestamp.

Transactions are counted regardless of result. A failed transaction that still charged a fee is a real cost to its payer and is included.

Processing Logic​

  • Grouping: Qualifying transactions are grouped by the period containing their consensus timestamp.
  • Averaging: Each period's value is the arithmetic mean of charged_tx_fee across that period's transactions, truncated to a whole number of tinybars.
  • Independence: Every period is computed on its own transactions. Unlike the cumulative statistics, values do not carry forward, so a period with no fee-bearing transactions produces no row rather than repeating the previous value.

Units​

The value is in tinybars (1 HBAR = 100,000,000 tinybars). To convert to HBAR, divide by 100,000,000. To express in USD, multiply the HBAR figure by avg_usd_conversion for the same period, remembering that it is scaled by 100,000.

GraphQL API Examples​

Test out these queries using our developer playground.

Fetch current average transaction fee (day)​

query AvgNetworkFeeDay {
ecosystem_metric(
order_by: { end_date: desc_nulls_last }
limit: 1
where: { name: { _eq: "avg_network_fee" }, period: { _eq: "day" } }
) {
total
end_date
}
}

Fetch hourly average transaction fee for 1 day (timeseries)​

query AvgNetworkFeeHourly {
ecosystem_metric(
order_by: { end_date: desc_nulls_last }
limit: 24
where: { name: { _eq: "avg_network_fee" }, period: { _eq: "hour" } }
) {
total
end_date
}
}

Available Time Periods​

The period field supports the following values:

  • hour
  • day

SQL Implementation​

Below is a link to the Hedera Stats GitHub repository. The repo contains the SQL function that calculates the Average Transaction Fee statistic outlined in this methodology.

SQL Function: ecosystem.avg_network_fee

View GitHub Repository →

Dependencies​

  • Hedera mirror node