Unraveling the MEV enigma: ABI-free detection model using Graph Neural Networks

Seongwan Park, Woojin Jeong, Yunyoung Lee, Bumho Son, Huisu Jang, Jaewook Lee

TL;DR

This paper introduces ArbiNet, a novel Graph Neural Network (GNN)-based model for detecting Maximal Extractable Value (MEV) transactions on blockchains without requiring knowledge of smart contract Application Binary Interfaces (ABIs). By leveraging token transfer graphs and a new, extensive MEV dataset, ArbiNet achieves high accuracy and recall, addressing key limitations of existing methods.

What Problem Does This Paper Address?

Maximal Extractable Value (MEV) is a significant factor influencing blockchain security and decentralization, especially with the rise of Decentralized Finance (DeFi). Detecting MEV is crucial for understanding consensus layer risks, evaluating anti-centralization solutions, and assessing user exploitation. However, current MEV detection methods suffer from several limitations:

  • Low Recall: They often miss novel or complex MEV strategies.
  • Dependency on ABIs: They require pre-registered Application Binary Interfaces (ABIs) and event logs from smart contracts, making them difficult to maintain as new DeFi services emerge.
  • Maintenance Overhead: The constant need to update ABI knowledge for new contracts is a significant burden.
  • Limited Scope: Existing methods struggle to capture the full spectrum of MEV transactions, particularly complex arbitrage strategies.

This paper aims to overcome these challenges by proposing an ABI-free detection model that is both accurate and maintainable.

Methods

The authors propose a two-step approach: data construction and model construction.

  1. Data Construction:
    • MEV Transaction Categorization: They identify and categorize MEV transactions into 2 types of sandwich attacks (Single DEX and Cross-DEX) and 5 types of arbitrage attacks (Simple Loop, Burn & Mint Mechanism, Set Token, Multi Address, and NFT Arbitrage). This classification includes novel strategies not previously discussed.
  2. Dataset Creation: Based on this categorization, they create a labeled MEV dataset, which they claim surpasses existing public datasets in terms of comprehensiveness.
  3. Model Construction:
    • Sandwich Detection Algorithm: A simple, ABI-free algorithm is proposed to detect sandwich attacks by analyzing token transfer data.
  4. ArbiNet (Arbitrage Detection Model): This is the core contribution. ArbiNet is a Graph Neural Network (GNN)-based model designed to detect arbitrage transactions.
  5. Graph Representation: Transactions are represented as token transfer graphs, where nodes represent addresses and edges represent token transfers.
  6. Feature Engineering: 14 node features are extracted, categorized into profits, tokens, addresses, and transfers, to capture crucial information for arbitrage detection.
  7. GNN Architecture: ArbiNet utilizes GNN layers (GCN, GraphSAGE, GAT) to learn patterns from these graphs. A readout layer aggregates node embeddings, and a linear layer performs the final binary classification (MEV vs. non-MEV).
  8. ABI-Free Operation: Crucially, ArbiNet operates solely on ERC-20 token transfer data, eliminating the need for smart contract ABIs or event logs.

Datasets

  • Custom MEV Dataset: The authors created a new, extensive labeled dataset of MEV transactions by categorizing and labeling them. This dataset is used for training and evaluating ArbiNet.
  • Comparison Datasets:
    • Weintraub et al. [45]: Used for comparison of labeled arbitrage data from a specific block range.
  • ZeroMEV [51] (Flashbots API): Used for comparison of labeled MEV data (arbitrage and sandwich) from a different block range.

Key Insights and Ideas

  • The "ABI Tax" on MEV Detection: Existing MEV detection methods are heavily reliant on smart contract ABIs and event logs, creating a significant maintenance burden and limiting their ability to detect new threats. This paper demonstrates that this dependency is not strictly necessary.
  • Novel MEV Strategies Exist: The authors identified and categorized several MEV strategies, particularly in arbitrage, that were not well-captured by previous heuristic-based methods. This highlights the evolving nature of MEV.
  • GNNs as a Powerful Tool for Transaction Analysis: Graph Neural Networks are well-suited for capturing the complex relationships and patterns within token transfer graphs, making them effective for detecting sophisticated MEV strategies like arbitrage.
  • Token Transfer Data is Sufficient: The research shows that by focusing on token transfer data alone, it's possible to achieve high accuracy in MEV detection, bypassing the need for contract-specific information.

Key Results

  • ArbiNet Performance: ArbiNet, using the GraphSAGE layer, achieved a high F1 score of 0.9854 on the test dataset. This significantly outperforms the F1 score of 0.6285 reported for Flashbots data, indicating a much higher recall rate.
  • Sandwich Detection: The proposed sandwich detection algorithm achieved high precision (0.9874), recall (0.9893), and F1 score (0.9883).
  • Dataset Superiority: The authors' labeled MEV dataset contained 20.6% more arbitrage transactions than a comparable public dataset from Weintraub et al. and showed a 91.4% difference in arbitrage transactions compared to Flashbots data.
  • Smart Contract Diversification: An analysis revealed a growing number and diversification of smart contracts used in MEV transactions, reinforcing the need for adaptable detection methods.
  • Feature Importance: An ablation study indicated that address and profit-related features are crucial for ArbiNet's performance, while transfer features have a smaller impact.

Limitations and Future Work

  • Explainability: ArbiNet, being a deep neural network, lacks explainability, making it difficult to understand why a specific transaction is classified as arbitrage. This is a common limitation of deep learning models.
  • False Positives: While ArbiNet has a high F1 score, it still produces false positives. The authors note that some of these false positives were due to novel MEV strategies or events not captured by their custom labeling process, suggesting ArbiNet's ability to detect new threats.
  • Future Work: The authors suggest that ArbiNet's ABI-free nature makes it well-suited for discovering new MEV transactions and contracts, potentially enabling the rapid identification of emerging threats. Further research could focus on improving the explainability of the model.

Summary updated

BibTeX
@article{park2024unraveling,
  author = {Seongwan Park and Woojin Jeong and Yunyoung Lee and Bumho Son and Huisu Jang and Jaewook Lee},
  title = {{Unraveling the MEV enigma: ABI-free detection model using Graph Neural Networks}},
  journal = {Future Generation Computer Systems},
  year = {2024},
  doi = {10.1016/j.future.2023.11.014},
}
Figure