MLR-XGB: Maximizing Ethereum Economy via Intelligent GasPrice Prediction

Effective GasPrice Prediction for Carrying Out Economical Ethereum Transaction

2020-01-01
Fangxiao Liu, Xingya Wang, Zixin Li, Jiehui Xu, Yubin Gao
Summary
Problem
Method
Results
Takeaways
Abstract

This paper introduces a Machine Learning Regression (MLR) approach to predict the lowest transaction gas price (gasPrice) in the upcoming Ethereum block. By leveraging XGBoost and five key on-chain influencing factors, the method facilitates more economical transactions without sacrificing confirmation speed.

TL;DR

Transaction fees (gas) on Ethereum are a notorious pain point for users. This paper proposes a Machine Learning Regression (MLR) framework, specifically using XGBoost, to predict the lowest gas price required for a transaction to be included in the next block. By analyzing five key blockchain metrics, the researchers achieved nearly 75% accuracy, saving over $17,000 in a one-month dataset while maintaining real-time performance (0.04s inference).

The "Overpayment" Problem: Why We Waste Money

In Ethereum's Proof-of-Work (and subsequently PoS) mechanism, miners/validators sort transactions primarily by gasPrice in descending order. However, blocks have a blockGasLimit. If your transaction is the last one to fit into a block, you pay the "lowest" price for that specific block.

The authors observed a massive disparity: while the average highest gas price in a block was 64.5 Gwei, the average lowest was only 4.2 Gwei. This means users choosing the higher end are paying over 15 times more than necessary for the exact same confirmation time. Current tools mostly provide static averages, failing to capture the volatile, non-linear dynamics of the network.

Methodology: The Five Pillars of Gas Pricing

The authors moved beyond simple moving averages (ST-AVG/ST-LOW) and identified five "influencing factors" that dictate the market equilibrium of gas:

  1. Transaction Gas Limit (TGL): Directly influences whether a transaction fits in the remaining space of a block.
  2. Ether Price (EP): If ETH price drops, miners often require a higher Gwei price to maintain their USD-denominated profit margins.
  3. Difficulty (D): Affects mining speed; higher difficulty reduces relative revenue, incentivizing miners to seek higher fees.
  4. Miner Reward (MR): A stable indicator of the total incentives currently within the ecosystem.
  5. Block Gas Limit (BGL): Defines the total supply of "space" per block.

Architecture: Why XGBoost?

The authors compared eight different models, including SVR, MLP, and LSTM. While LSTMs are typically favored for time-series data, MLR-XGB (Extreme Gradient Boosting) proved superior. Its ability to handle non-linear relationships and prevent over-fitting through gradient boosting made it the most robust choice for the "noisy" environment of blockchain data.

Model Comparison and Trend Analysis Figure: Analysis showing the MLR-LR and other regression models' ability to track real gas price trends.

Experimental Results & Performance

The study was conducted on a massive dataset of 194,331 blocks and over 20 million transactions.

  • Accuracy (Category C2): The "ideal case" (where the predicted price is lower than the original but still high enough to be included) reached 74.9% with XGBoost.
  • Cost Savings: In a test set of 36,210 transactions, the model saved $17,552.18 (57.17 Ether).
  • Latency: Inference takes only 0.04 seconds, well within Ethereum's ~12-second block time, making it viable for live wallet integration.
ModelRMSE (Test)MAE (Test)Accuracy (C2)
ST-LOW (Baseline)3.221.8052.37%
MLR-LSTM3.041.7626.00%
MLR-XGB (Ours)2.751.5474.90%

Cost Savings Statistics Table: Quantitative evidence of total Ether and USD saved across different models.

Critical Insight & Conclusion

The core takeaway is that Ethereum gas prices are not random; they are the result of measurable economic pressures (Ether price, difficulty, and rewards). By treating gas prediction as a regression problem rather than a simple statistical average, the MLR-XGB model effectively finds the "floor" of the market.

Limitations: The paper reflects the Ethereum environment of 2019. Post-EIP-1559 (London Hard Fork), the gas mechanism introduced a "Base Fee" and "Priority Fee," which slightly changes the feature engineering requirements. However, the logic of using ML to target the "Tip" (Priority Fee) remains highly relevant for today's MEV-heavy landscape.

Ultimately, this work proves that high-frequency blockchain data can be mined in real-time to significantly reduce the "tax" users pay to interact with decentralized applications.

Find Similar Papers

Try Our Examples

  • Find recent papers or SOTA methods beyond 2019 that utilize Deep Reinforcement Learning for dynamic Ethereum gas price estimation.
  • Which paper first established the correlation between Miner Extractable Value (MEV) and gas price volatility, and does this work account for MEV in its miner reward (MR) feature?
  • Explore research that applies XGBoost or similar ensemble learning techniques to predict transaction fees in Layer 2 scaling solutions like Arbitrum or Optimism.
Contents
MLR-XGB: Maximizing Ethereum Economy via Intelligent GasPrice Prediction
1. TL;DR
2. The "Overpayment" Problem: Why We Waste Money
3. Methodology: The Five Pillars of Gas Pricing
3.1. Architecture: Why XGBoost?
4. Experimental Results & Performance
5. Critical Insight & Conclusion