Abstract
Miner Extractable Value (MEV) represents the profit potential available to blockchain validators through the strategic ordering of transactions. As the MEV landscape shifts toward private auctions like Flashbots to mitigate public "gas wars," developing optimal bidding strategies has become a complex challenge. This paper presents a comprehensive analysis of Flashbots bidding behavior and introduces a machine learning approach using LightGBM to predict winning bids. Our results show that ML-driven strategies can win over 50% of arbitrage auctions, significantly outperforming traditional heuristics and doubling captured profits.
Introduction
MEV is a critical component of blockchain economics, typically realized through arbitrage or "sandwich" attacks. To avoid the inefficiencies of public priority gas auctions, many bots (searchers) utilize private relay services such as Flashbots. These services operate as first-price sealed-bid auctions where bots submit transactions along with a "bribe" to validators. The opacity of these auctions makes it difficult to determine the optimal bid—bidding too low results in lost opportunities, while bidding too high reduces net profit. This research aims to optimize bot profitability by analyzing historical bidding data and applying predictive modeling.
Methodology
The researchers developed a sophisticated pipeline to classify and analyze MEV transactions from the Ethereum blockchain.
The methodology consists of four primary stages:
- Classification: A custom Python tool identifies cyclic arbitrage and sandwich attacks using block traces from an Ethereum archive node.
- Feature Engineering: Key predictors identified include block height, potential profit, gas requirements, and specific DeFi protocols (e.g., Uniswap v2/v3).
- Machine Learning: The
LGBMRegressorframework was employed to predict the "bribe ratio"—the percentage of total profit offered as a fee. - Hybrid Modeling: To handle high-profit outliers where data is sparse, a hybrid model combines ML predictions for standard transactions with constant bribe ratios for rare, high-value events.
Data Analysis and Insights
The study analyzed a dataset of 572,970 arbitrage transactions and 443,273 sandwich attacks over a 200-day period (June 2022 to January 2023). This period includes the Ethereum "Merge," which significantly altered the MEV landscape.
Key findings include:
- The Merge Shock: Following the transition to Proof-of-Stake and Proposer-Builder Separation (PBS), average bribe ratios for arbitrage dropped from approximately 85% to 75%.
- Competitive Dynamics: Sandwich auctions are extremely competitive ("Red Ocean"), with bribe ratios often exceeding 91%, indicating that bots sacrifice nearly all revenue to secure inclusion.
- Determinants of Success: Feature importance analysis revealed that gas consumption and block timing are more critical to winning bids than the specific assets being traded.
Performance Results
The Hybrid ML model was benchmarked against static and moving-average baselines:
- Arbitrage: The ML model achieved a 50.21% win rate and captured 500.73 ETH in profit, more than double the 244.78 ETH earned by the best non-ML dynamic baseline.
- Sandwiching: The model won 31.01% of auctions. However, in this hyper-competitive niche, static heuristics occasionally outperformed the ML model by capturing rare "whale" transactions with high fixed bids.
Conclusion
This research demonstrates the efficacy of machine learning in navigating the opaque environment of MEV auctions. While the current models show significant promise, they operate under a static environment assumption. Future work should explore Reinforcement Learning (RL) to account for the game-theoretic nature of these auctions, where competitors actively adapt to new strategies in a continuous "cat-and-mouse" game.
Summary updated