# If It Walks Like an Arbitrage: Protocol-Agnostic Detection with Decidable Structural Equivalence

arXiv: https://arxiv.org/abs/2608.20377 · HTML: https://mlsanity.com/paper/2608.20377/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 17 of its 47 references that are in the map.
- First posted on arXiv 26 Jun 2026.

## Builds on (most cited first, 17 of 17)

- [SoK: Decentralized Finance (DeFi) Attacks](https://mlsanity.com/paper/2208.13035/) (2022)
- [Quantifying Blockchain Extractable Value: How dark is the forest?](https://mlsanity.com/paper/2101.05511/) (2021)
- [Attacking the DeFi Ecosystem with Flash Loans for Fun and Profit](https://mlsanity.com/paper/2003.03810/) (2020)
- [Frontrunner Jones and the Raiders of the Dark Forest: An Empirical Study of Frontrunning on the Ethereum Blockchain](https://mlsanity.com/paper/2102.03347/) (2021)
- [Detecting Financial Bots on the Ethereum Blockchain](https://mlsanity.com/paper/2403.19530/) (2024)
- [Clockwork Finance: Automated Analysis of Economic Security in Smart Contracts](https://mlsanity.com/paper/2109.04347/) (2021)
- [Cyclic Arbitrage in Decentralized Exchanges](https://mlsanity.com/paper/2105.02784/) (2021)
- [Rolling in the Shadows: Analyzing the Extraction of MEV Across Layer-2 Rollups](https://mlsanity.com/paper/2405.00138/) (2024)
- [Maximal Extractable Value in Decentralized Finance: Taxonomy, Detection, and Mitigation](https://mlsanity.com/paper/2411.03327/) (2024)
- [Enhancing Smart Contract Security Analysis with Execution Property Graphs](https://mlsanity.com/paper/2305.14046/) (2023)
- [Demystifying DeFi MEV Activities in Flashbots Bundle](https://mlsanity.com/paper/2312.01091/) (2023)
- [Non-Atomic Arbitrage in Decentralized Finance](https://mlsanity.com/paper/2401.01622/) (2024)
- [ETrace:Event-Driven Vulnerability Detection in Smart Contracts via LLM-Based Trace Analysis](https://mlsanity.com/paper/2506.15790/) (2025)
- [Unraveling the MEV Enigma: ABI-Free Detection Model using Graph Neural Networks](https://mlsanity.com/paper/2305.05952/) (2023)
- [Remeasuring the Arbitrage and Sandwich Attacks of Maximal Extractable Value in Ethereum](https://mlsanity.com/paper/2405.17944/) (2024)
- [SoK: The Evolution of Maximal Extractable Value, From Miners to Cross-Chain](https://mlsanity.com/paper/2603.07716/) (2026)
- [PEB Separation and State Migration: Unmasking the New Frontiers of DeFi AML Evasion](https://mlsanity.com/paper/2603.26290/) (2026)

## Abstract (arXiv)

Whether a transaction performed an arbitrage, and by which route, is a question asked of its execution trace after the fact. We conjecture that such traces admit a normal form on which questions of this kind become queries, and we test it by building one and putting it to work. Each trace becomes an abstract syntax tree of token transfers, grouped by call- frame nesting. A term rewriting system of 16 rules reduces it. Rewriting terminates and carries exactly the transfers of the trace, whichever order the rules fire in. Under a deterministic kernel scanning the EVM-fixed trace order, every trace has a unique normal form, and the structural equivalence this induces on fund flows is decidable. Preservation, termination, soundness, uniqueness and decidability are mechanized in Rocq with zero admitted obligations. We report arbitrage detection in full: cycles emerge at the fixpoint and are read off the normal form with no protocol-specific patterns. Detection is the query we evaluate at scale; structural equivalence is a second query. The pipeline depends only on the standard ERC token and WETH ABIs, so the same binary runs unmodified on Arbitrum and BSC. We evaluate on two arbitrary block ranges, analysed in full with no transaction excluded: 220 000 Ethereum blocks against EigenPhi, a widely used MEV detection platform, and 1 000 shared blocks against ArbiNet, a graph neural network classifier. These are the only tools and label sets in this domain we were able to reuse. We report 469 801 confirmed arbitrages, overlapping 83.5% with EigenPhi and 81% with ArbiNet, together with 245 497 attempted arbitrages and 60 199 confirmed detections EigenPhi does not report. 99.2% follow from the fixpoint alone and are sound over the decoded transfers, and manual validation of 500 transactions finds no false positive among the confirmed.
