In a second part, which will be released later, we want to compare gas prices between different networks.
How is the Gas Price determined?
Essentially gas fees are compensations for the computational work which is needed for every transaction, smart contract execution and deployment, and it is paid by the users which conduct the operation. The fee is awarded to miners, who verify the operations. The lower the user sets the gas price, the more likely the transaction will be ignored or takes a long time to process. Consequently if you set the gas price high, you can “skip the queue” and your operation is verified faster.
The gas price depends on many factors. Such as the amount of transactions, staking and investing in different tokens, and the amount of bytecode to process. Larger amounts of bytecode to process lead to higher transaction fees, because more gas is consumed.
For further information please visit: What is Ethereum Gas? [The Most Comprehensive Step-By-Step Guide Ever!].
Why do we need to track the Gas Price?
Therefore we are going to examine three different visualizations. First we are going to analyze the daily gas prices for a timespan of two years. We will try to find seasonal differences, analyze gas price spikes and interpret how they emerged.
In the second visualization the objective is to analyze the hourly gas price chart for the week of 5th October 2020 to 12th October 2020. In this chart we will examine the hourly gas price differences and search for patterns between different days of the week. A possible pattern to find would be clearly visible gas price differences between weekdays and weekends.
Last but not least we will examine the gas prices per minute for the past day. Here we hope to find daily patterns, which could save us money by submitting transactions at a point in time at which the gas price is low.
Gas Price Trends on Ethereum
Daily Gas Price
The first observation that stands out is that the gas price was fairly consistent up until March 2020. The gas price for a fast transfer was mostly between 30-40 gwei. Before March 2020 a standard transfer required fees of 10-20 gwei. The price difference between a slow and standard transfer was mostly irrelevant. After the March 2020 spike, an upwards trend began. The gas price exploded. In the timeframe between March and October 2020 the gas price rose up to levels over 200 gwei. The fee for a fast transfer peaked at 750 gwei on September 17. A standard transfer on September 17 cost 561 gwei. Since September 17 we observe a downwards trend and the gas price reaches levels of 60-70 gwei.
There are certain ideas that try to explain the sudden surge of the gas price in March 2020 and the sharp upwards trend of the gas price since July 2020. Some argue that the March 2020 spike was on one hand caused by the Coronavirus pandemic resulting in a sell-off activity, which triggered a black swan event and ultimately a stock- as well as crypto-market sell-off and this chain reaction’s interaction with DeFi lending position liquidations caused by the crypto-market sell-off on the other hand. (See Peaster on Blockonomi). Some others (GAINS Associates on Medium) reason the upwards trend of the gas price with:
- The surge of new ETH addresses: From less than 10 million addresses which did hold ETH in Q1 to over 40 million in Q3 of 2020.
- Increasing network demand in ETH
- Rise in Decentralized Finance smart contracts
Yet some others argue that the Ethereum fee model is contributing to the surge in gas price and that Ethereum 2.0 will resolve some gas price issues by using a proof-of-stake algorithm (Kordyban on Hedgetrade).
The two year chart shows no clear signs of seasonality effects. Conclusively it can be expected that the gas price will reach a constant level, albeit a higher level than before the gas price explosion.
Hourly Gas Price
There are a few different patterns we want to look into. First of all we want to look at the gas price difference between weekdays and weekends. Observing the chart shows that the lowest hourly gas prices occur between Saturday and Monday. During Tuesday and Wednesday, as well as Friday and Saturday night the prices spike tremendously.
Now let us have a look at the price differences at various hours of the day. Could it be useful to submit transactions only on certain hours? For this analysis we created a chart for the hourly gas prices for the past four weeks. Let’s see if we can spot hourly patterns:
Per Minute Gas Price
Now let’s move on to the third chart in this blog article. In this chart we analyze the per minute gas price. We can observe the percentiles for a slow (30.0 Percentile), standard (60.0 Percentile) and fast (90.0 Percentile) transfer, highlighted in blue, red and green. We plotted the per minute prices for a timespan of one day.
Are there any intra day patterns visible? Can we see the same early hours pattern as in the hourly past day chart?
Findings of Ethereum Gas Price Analytics
- Large scale events will drive gas prices up (token releases, black swan events…).
- There is evidence towards higher gas prices. This might be related to the general adoption of Ethereum for DeFi.
- Gas prices are higher on weekdays than on weekends.
- Transactions are more expensive in the morning than in the evening or night. The gas price spikes daily between 5.00 and 11.00 am UTC.
Methods used in Gas Price Analytics
For the aforementioned use-cases it is necessary to query the Ethereum Mainnet index. The ElasticSearch host address therefore is:
https://api.anyblock.tools/ethereum/ethereum/mainnet/es/
Fetching the daily percentiles of the gas price for the past two years is as easy as:
# Initialize the ElasticSearch Client
def initialize_elastic(network):
es = Elasticsearch(hosts=[network],
http_auth=('EMAIL/USERNAME',
'APIKEY'),
timeout=180)
return es
network = 'https://api.anyblock.tools/ethereum/ethereum/mainnet/es/
# define a function to fetch daily percentiles for the past 2 years
def fetch_gas_day(network):
es = initialize_elastic(network)
return es.search(
index = 'tx',
doc_type = 'tx',
search_type = 'scan',
body = {
"_source":["timestamp","gasPrice.num"],
"query": {
"bool": {
"must": [{
"range":{
"timestamp": {
"gte": "now-2y"
}
}}
]
}
},
"aggs": {
"hour_bucket": {
"date_histogram": {
"field": "timestamp",
"interval": "1d",
"format": "yyyy-MM-dd hh:mm:ss"
},
"aggs": {
"avgGasDay": {
"avg": {
"field": "gasPrice.num"
}
},
"percentilesDay": {
"percentiles": {
"field": "gasPrice.num",
"percents": [35,60,90,100]
}}
}
}
}, "size":0
})
This query returns the timestamp and the aggregation (the percentiles for a slow, standard, fast and instant transfer).
Changing this query for hourly aggregations is as easy as changing the "interval": "1d"
to "interval": "1H"
and the timestamp range to "gte": "now-7d"
.
The same logic applies to the aggregation of minutes, as you see, changing the intervals is as easy as changing a few values.
If you are interested in inspecting the entire code for this blog article, please look here. The code shows the entire process of fetching the data, preprocessing it and plotting the results.
Conclusion
With the Anyblock API it is easy to fetch blockchain data to do analytics, create charts and get insights into different blockchain networks. I recommend checking out our API documentation, our gas price API endpoint, our block explorer as well as our blockchain dashboards.

Interested or questions?
Freddy Zwanzger
(Co-Founder & Chief Data Officer)
freddy@anyblockanalytics.com
+49 6131 3272372