- The paper introduces two innovative systems, DeFiPoser-ARB and DeFiPoser-SMT, which automate the discovery of profit-generating transactions in DeFi protocols.
- It employs graph-based negative cycle detection and SMT solving to optimize both arbitrage and acyclic trading strategies for real-time execution.
- Empirical evaluations show substantial revenue generation and highlight significant Miner Extractable Value (MEV) risks impacting blockchain consensus security.
Just-In-Time Discovery of Profit-Generating Transactions in DeFi Protocols
Problem Statement and Motivation
Automated discovery and execution of profit-generating trades in Decentralized Finance (DeFi) protocols is both practically important and theoretically challenging due to the composability and atomicity of actions in DeFi markets. DeFi enables users to sequence actions across lending, exchanging, staking, and borrowing platforms, forming complex financial strategies that can yield significant revenue. Because all DeFi states and user balances are publicly readable, the central question is how to algorithmically and efficiently construct profitable transactions given the dynamically intertwined state space of multiple DeFi platforms.
System Architecture
The paper introduces two complementary real-time search algorithms—DeFiPoser-ARB and DeFiPoser-SMT—capable of discovering and synthesizing atomic sequences of DeFi actions to maximize trader revenue.
Figure 1: DeFiPoser-ARB and DeFiPoser-SMT system overview. DeFiPoser-ARB uses graph-based negative cycle detection; DeFiPoser-SMT employs symbolic modeling and SMT solving for acyclic strategies.
DeFiPoser-ARB constructs a directed weighted graph of DeFi markets, where vertices represent assets and edges are priced according to spot market conversion rates. Arbitrage opportunities are detected via negative cycle search (Bellman-Ford-Moore). Each identified cycle is concretely parameterized and executed atomically.
DeFiPoser-SMT models DeFi action sequences as symbolic state transition systems, translates them into constraints over real-valued variables, and employs theorem proving (Z3) to both check satisfiability and optimize parameters for non-cyclic strategies, supporting more general profit-yielding actions beyond pure arbitrage.
Figure 2: Technical design choices of DeFiPoser. Path pruning, parameter search, and strategy execution components define the workflow.
DeFi Modeling and Pruning
DeFiPoser-SMT encodes the trader and market states, action parameters, and transition functions in a unified logical framework, maximizing base asset balances. The combinatorial explosion in possible paths is mitigated by seven aggressive heuristics, discarding unprofitable and redundant action sequences based on asset dependencies, reversibility, entry/exit points, and other independence criteria. Empirical results demonstrate that heuristics eliminate 99.98% of possible paths, reducing the search space from billions of sequences to a manageable set for real-time analysis.
Empirical Evaluation: Trading Strategies and Revenue
The tools were evaluated on a real-world Ethereum blockchain snapshot (blocks 9,100,000–10,050,000, 150 days), over 96 distinct actions and 25 assets, covering Uniswap, Bancor, and MakerDAO, representing 82% of USD value locked in DeFi at the measured time.
DeFiPoser-ARB discovered 2,709 arbitrage strategies with a cumulative concrete-execution revenue of several thousand ETH. Average weekly revenue is estimated to be O(1)M USD-equivalent, depending on transaction fees and network state.
DeFiPoser-SMT identified 13,317 strategies (validated via EVM replay), including acyclic profit opportunities, with highest single-strategy profits exceeding \$500k USD and majority requiring only minimal capital (less than 1 ETH with flash loans).
Figure 3: Analytical distribution of trader revenue. Most profitable strategies consist of three actions.
Figure 4: Distribution of trader revenue using DeFiPoser-ARB. Multi-cycle strategies yield significant capital.
Capital Requirements: The majority of strategies were executable with sub-150 ETH, dropping to sub-1 ETH given flash loans, effectively eliminating currency exposure risk.


Figure 5: Cumulative revenue over 150 days, validated via concrete execution.
Transaction Costs: Gas costs remain negligible relative to extracted revenues for both systems—even for multi-market arbitrage, transaction fees are less than 0.05 ETH per trade.
Both designs achieve execution times below Ethereum's average block time (13.5s), with DeFiPoser-SMT and DeFiPoser-ARB averaging 5.39s and 6.43s per block, respectively (unoptimized, 64-core system). Negative cycle searches and SMT solving are both parallelizable for practical deployment.
Figure 6: Analysis time distribution for profitable strategy detection.
Security Implications: Miner Extractable Value and Protocol Vulnerability
The tools are demonstrated to detect historic economic attacks, including the bZx event, where high-revenue strategies existed for up to 69 days before exploitation, yielding 0.48M USD. Opportunities such as these, whose profit far outpaces block rewards (up to 874x in the bZx case), generate Miner Extractable Value (MEV)—additional rewards that rational PoW miners may pursue via transaction reordering or chain forking, threatening consensus security.
Figure 7: Minimum MEV value (in block rewards) for incentive-compatibility of PoW forks. Adversarial miners with 10% hash rate will fork for MEV opportunities exceeding 4 block rewards.
A quantitative Markov Decision Process analysis reveals that miners with modest hash rates will rationally fork the chain to seize MEV opportunities if their value exceeds 4x the block reward, increasing stale block rates and double-spending risks.
Figure 8: Attack window analysis of the bZx event; DeFiPoser-SMT identifies opportunity duration and concrete revenue.
Practical and Theoretical Implications
Operationalizing DeFiPoser demonstrates both the feasibility and risk associated with automated, just-in-time profit extraction in DeFi. Practically, protocol designers and liquidity providers gain quantitative insights into arbitrage and economic vulnerabilities in their system deployments. Theoretically, the results clarify a new frontier in blockchain security: composability-driven MEV, where protocol-level innovation elevates financial risks at the consensus layer. As DeFi protocol expansion and cross-chain interoperability accelerate, tooling such as DeFiPoser will be critical for adversarial stress-testing and adaptive defense.
Future Directions
Anticipated future developments include:
- Expansion to transaction-level state dependency, incorporating mempool monitoring for even finer profit extraction.
- Generalization to multiple base assets and execution in cross-chain DeFi ecosystems.
- Modeling dynamic trader competition and miner collusion under MEV opportunity adversarial games.
- Integration with decentralized governance to dynamically tune protocol parameters in response to discovered composability vulnerabilities.
Conclusion
This paper rigorously formulates and implements algorithmic discovery of profit-generating sequences across composable DeFi protocols. Real-time arbitrage and acyclic exploitation are achievable and practical. The scale of available profits, especially those qualifying as MEV, materially threatens PoW blockchain stability and consensus guarantees. As DeFi complexity proliferates, automated reasoning tools will be indispensable for protocol analysis, adversarial security assessment, and ecosystem resilience.