MLR-XGB: Maximizing Ethereum Economy via Intelligent GasPrice Prediction
Effective GasPrice Prediction for Carrying Out Economical Ethereum Transaction
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:
- Transaction Gas Limit (TGL): Directly influences whether a transaction fits in the remaining space of a block.
- Ether Price (EP): If ETH price drops, miners often require a higher Gwei price to maintain their USD-denominated profit margins.
- Difficulty (D): Affects mining speed; higher difficulty reduces relative revenue, incentivizing miners to seek higher fees.
- Miner Reward (MR): A stable indicator of the total incentives currently within the ecosystem.
- 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.
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.
| Model | RMSE (Test) | MAE (Test) | Accuracy (C2) |
|---|---|---|---|
| ST-LOW (Baseline) | 3.22 | 1.80 | 52.37% |
| MLR-LSTM | 3.04 | 1.76 | 26.00% |
| MLR-XGB (Ours) | 2.75 | 1.54 | 74.90% |
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.
