Image of a weekly planner together with a pen and a phone
Image courtesy of http://www.ktcupoftea.com

Ethereum: how to save even more on gas price with a weekly plan

Marco Marchioro
DEXTF Protocol
Published in
8 min readAug 2, 2020

--

An analysis of the weekly periodicity of the Ethereum blockchain reveals that the best time to submit a transaction is during the weekend.

As I have shown in a companion post¹, Ethereum transactions are observed to be more frequent during the Asian daytime which means that one can save on gas prices if they are willing to wait for the Asian wee hours. In this post I will share how to save even more on gas prices by waiting until weekend to submit the most costly transactions. I also show the hourly dependence of the gas price and the throughput for each single day of the week.

Recently the Ethereum blockchain has been performing close to capacity in terms of average transactions per second (TPS). As a consequence miners can be pickers and choose only transactions with higher gas prices. In turn, this logical behaviour has increased the average gas price paid to submit transactions to the Ethereum blockchain. The success story of many DeFi solutions has caused many headaches because of the rising gas costs and the long queues in submitting transactions.

As part of DEXTF Protocol project, I often have to submit transactions to the blockchain and interact with many different smart contracts. While some of these transactions have an immediate urgency and need to be performed as soon as possible, many others can wait for a few days.

To minimize this problem, you can create a weekly plan to submit non-urgent transactions in days when both gas prices and the throughput are low.

Weekly periodicity of transactions

We do not need to run a full Ethereum node to obtain transaction data since¹, fortunately for us, there is a mirror of the blockchain accessible as a BigQuery public dataset. Using the same dataset as the companion post¹ we investigate here what is the best day in a week to submit transactions to the blockchain in order to save on gas prices. Since the first few years of the blockchain history are somewhat unique¹, we only analyze transactions data for recent years, i.e. since January 2018.

In the following chart (Fig.1), we show the hourly-average throughput, measured in transactions per second (TPS), for the Ethereum blockchain from Jan-2018 onwards:

Chart of the hourly-average throughput for the Ethereum blockchain for recent years
Fig.1: hourly-average throughput for the Ethereum blockchain for recent years, i.e. since January 2018

In the above chart, the thick red graph plots the weekly average throughput. We can immediately recognize that the above process is not stationary since even the weekly average is not constant. A stationary process is a stochastic variable that may change with time, for which the statistical properties, such as the mean and the standard deviation, are constant. When performing a statistical analysis it is easier to work with stationary processes. Hence, in order to make our variables stationary we compute the surplus, i.e. the percentage increase, of the hourly-average with respect to the weekly average. For the throughput we obtain the following result:

Chart of the surplus of the hourly throughput measured as a percentage of its week-average
Fig. 2: surplus of the hourly throughput measured as a percentage of its week-average

Similarly for the gas price we have:

Chart of the surplus of the hourly gas price measured as a percentage of its week-average
Fig. 3: surplus of the hourly gas price measured as a percentage of its weekly average. (For visual convenience the percentages higher than 300% are not shown.)

The charts shown in Fig. 2 and 3 are remarkably different since the throughput surplus is mostly limited to 100%, while the gas-price surplus is often above 100%. While the statistical analysis of these two variables is beyond the scope of this work, even a casual glance at the two charts reveals that the two distributions are noticeably different.

Since the surplus variables are stationary, or rather almost (-quasi) stationary, we can compare their values at different dates. In the companion post¹ we indicate the hourly dependence of these variables, here we compute the average surplus conditionally to the day of the week:

Chart of the average surplus of gas prices and throughput for each day of the week
Fig. 4: average surplus of gas prices and throughput for each day of the week

As someone might have suspected by the subtitle of this post, for both variables we observe a positive average surplus during the weekdays and a negative one on weekends. This means that in order to save on gas, on average, it is better to wait for the weekend to submit transactions to the Ethereum blockchain.

Remarkably the average surplus during each day is quantitatively similar for both variables. This is surprising since, as noted earlier, the two variables have markedly different statistical properties. Indeed, there must be a close relationship between these two variables as they influence each other. This relationship will be explored in a future work.

Weekend hourly periodicity results

In the companion paper¹ the conclusion was that it is better to wait for the Asian nighttime in order to submit transactions with lower gas prices. In the previous section we observed lower throughput and gas prices, on average, during the weekends. Suppose that we want to follow both these advices, a natural question arises:

What is the best time, on a weekend to submit transactions?

To answer this question we compute the average of the variable surpluses conditional to both the hour and the day concurrently. Note that the hours are always measured using the Coordinated Universal Time (aka UTC). The results for Saturdays are shown in the following chart:

Chart of the average surplus of gas prices and throughput for Saturdays
Fig. 5: Average surplus of gas prices and throughput for Saturdays

Similarly, for Sundays we have

Chart of the average surplus of gas prices and throughput for Sundays
Fig. 6: Average surplus of gas prices and throughput for Sundays

The result for both days are very similar and there is no obvious choice of which day would give more benefits.

We also notice that the gas-price surplus stays negative for most of the weekend, with small positive peaks at 2 pm and 3 pm UTC on both Saturdays and Sundays.

On the other hand, the throughput is more irregular and has some noticeable positive peeks at 7 am and 8 am UTC time. Again the best saving on gas prices are during the Asian after hours, i.e. between 6 pm UTC (2 am in Singapore) and midnight UTC (8 am in Singapore).

Combined day and hourly periodicity results

We have established that the best time to save on gas prices, on average, is to submit transactions between 2 am and 8 am Singapore time. This is consistent with Singapore being one of the most vibrant places for companies in the DeFi space. However, one might have the urgency to submit transaction on any given day of the week. Hence we may ask ourselves the following question:

On any given day, what is the hourly distribution of gas prices and throughput?

To answer this question we plot, separately for each day, the hourly average of the two variables under consideration. For the gas price we have:

The 7 charts of the average surplus of gas price for each single day of the week
Fig. 7: average surplus of gas price for each single day of the week

While for the throughput we have:

The 7 charts of the average surplus of throughput for each single day of the week
Fig .8: average surplus of throughput for each single day of the week

Again, qualitatively on any given day the shape of the plot is similar for both variables, as noticed earlier, this is an indication of the co-dependence of these two variables. Also, in both cases the shape of the charts for the weekends are different from those in the weekdays. Looking a bit more carefully at the chart for the weekdays, we notice more uniformity in the charts for the throughput and less in the charts for the gas price. Specifically the shape of the hourly gas-price surplus on Thursday is different from the other days and has an higher peak of about +30% around noon UTC.

It is sometimes useful to look at the same data from different point of views. Very often we can plot the same data using different chart types to obtain more insights from the data. In this case, it is useful to look at the percentage surplus variables by plotting them on a two-dimensional heatmap. The gas-price heatmap is shown in the following chart:

Chart of the surplus gas-price heatmap for each day of the week (the vertical coordinate) and hour (the horiz. coordinate)
Fig. 9: the percentage surplus gas-price heatmap for each day (the vertical coordinate) and hour (the horizontal coordinate) of the week

Similarly, the throughput heatmap is shown in the following chart:

Chart of the surplus throughput heatmap for each day of the week (the vertical coordinate) and hour (the horiz. coordinate)
Fig. 10. the percentage surplus throughput heatmap for each day of the week (the vertical coordinate) and hour (the horizontal coordinate)

Both heatmaps are characterized by a dark-red (higher surplus) zone during the Asian working day on weekdays and by a dark blue zone (lower surplus) during the Asian weekend nights. In the throughput heatmap the vertical lines are more apparent while the gas-price heatmap looks more jagged.

This means that hourly throughput does not depend much on the exact day it is observed, either on weekdays or on weekends. Also we note that the worst time during the week for gas prices is observed on Thursdays at UTC noon, or 8 pm in Singapore. On the other hand the throughput seems to be consistently highest on all weekdays at 8 am UTC time, or 4 pm in Singapore.

Conclusions

In this post we show the dependence of the average surplus in gas prices and throughput for each day of the week and each hour.

As shown by the heatmap charts above, it turns out that both variables show a strong dependency on the hour and the day regardless of weekday or weekend considerations.

We also establish that, in order to save on gas prices, the best time is to submit our transaction is the early weekend morning Singapore time and the worst time is on Thursdays at around 8pm, Singapore time.

Since the Ethereum blockchain does not sleep and does not take weekend breaks, the fact that there is indeed a time periodicity means that transactions are submitted to the blockchain by humans, according to their own schedule. With the growing presence of sleepless and unfaltering bots, and the fast evolution of artificial intelligence, we expect to observe in the years to come less and less hourly or weekly periodicity on transactions in all blockchains.

Footnotes

  1. Refer to this earlier post in which we discusses the average hourly gas price and throughput

--

--

Marco Marchioro
DEXTF Protocol

Ph.D., Crypto quant, Blockchain, Algo Trading, Algorand, QuantLib founder