- The paper presents concave continuation to extend AMM trade functions into negative input domains, thereby unifying routing and arbitrage under a single optimization framework.
- It develops an extended transfer algorithm that ensures unique and robust on-chain computations with optimal convergence rates and prevents allocation sign-crossing.
- Empirical evaluations via simulations and on-chain tests demonstrate significant runtime improvements and effective arbitrage capture in real-world DeFi environments.
Concave Continuation and the Unified Routing-Arbitrage Problem in AMMs
Introduction
The paper "Concave Continuation: Linking Routing to Arbitrage" (2604.02909) establishes a principled framework for extending Automated Market Maker (AMM) trade functions to negative input domains, formalizing this extension as "concave continuation." This analytic construction enables a unification of routing and arbitrage problems, treating arbitrage as a special case of routing where the net input size is zero. The work rigorously derives this result from the invariance of the local conservation law under directional flips in trade allocation, enabling efficient on-chain computation and algorithmic resolution using extended transfer algorithms.
Preliminaries and Trade Function Extension
AMMs in decentralized exchanges (DEXs) are characterized by concave trade functions mapping inputs of one token to outputs of another. The transfer algorithm for routing—initially restricted to non-negative allocations—iteratively equalizes pool prices to maximize output, leveraging marginal price alignment across AMMs. The foundational assumption includes first-order differentiability, strict monotonicity, strict concavity, no-free-lunch at zero input, and a change-of-numeraire condition.
Concave continuation analytically extends the trade function to negative inputs. For a given AMM trade function EX,Y(x) (mapping input x of token X to output Y), the concave continuation for x<0 is defined as:
EX,Y(x)=−(EY,X)−1(−x)
where EY,X(⋅) is the reverse trade function. This extension is uniquely determined by the requirement that the local conservation law remains form-invariant under allocation direction flips. The analytic properties (monotonicity, concavity, and C1 continuity at zero) guarantee the well-posedness of the extended trade function.
Routing-Arbitrage Unification
Standard AMM routing optimizes the allocation of given token input across pools to maximize output, subject to non-negativity constraints. With concave continuation, the optimization domain expands: allocations can now be negative up to the reserve size, allowing pools to both produce and consume output tokens. Formally, the routing-arbitrage problem is given by:
xmaxF(x)=i=1∑NEX,Yi(xi)
subject to xi≥−Ri, x0
where x1 is the reserve of token x2 in pool x3 and x4 corresponds to pure arbitrage.
The strictly concave objective ensures uniqueness of the solution, and the allocation domain and conservation law are linear, yielding a tractable optimization problem that generalizes both routing and arbitrage.
Extended Transfer Algorithm
The paper introduces an extended transfer algorithm tailored for routing-arbitrage. Initialization distributes token input greedily, maintaining legitimacy by allocating only to pools with minimum price, thereby avoiding "sign-crossing" that would preclude optimal convergence. The halving rule is adapted to respect the domain: for positive allocations, bisection occurs over x5; for negative allocations, over x6.
The runtime analysis proves several strong invariance properties:
- Allocations once positive (or negative) remain so throughout the algorithm, preventing sign-crossing.
- Pools with strictly positive or negative optimal allocation will never be assigned the opposite sign during execution.
- The algorithm converges to the unique optimum and inherits optimal convergence rate x7 from prior work, where x8 is the number of pools and x9 a liquidity-dependent parameter.
Empirical Evaluation
Comprehensive experiments validate the extended algorithm in simulated and real-world environments:
- Python Simulation on Uniswap V2 Pools: The extended transfer algorithm matches convex optimization (CVXPY) outputs [angeris-routing], while consistently outperforming it in runtime (up to 22x faster for X0).
- Julia Simulation on Uniswap V3 Pools: The extended algorithm matches CFMMRouter.jl [diamandis-routing] in allocation and output across various pool sizes, again demonstrating superior execution speed.
- On-chain Validation (Base Network): The algorithm is implemented on-chain using Uniswap V3 APIs, incurring reasonable gas costs. In equilibrium scenarios on heavily traded USDC/WETH pools, MEV and fees remove arbitrage, so concave continuation yields identical output to original routing. When induced price discrepancies are present, the algorithm captures significant arbitrage (X149bps improvement, X2 \$560), with lower gas usage.
Theoretical and Practical Implications
The formulation of concave continuation as a domain extension for trade functions provides an elegant, physically motivated analytic foundation for unified routing-arbitrage optimization in AMMs. By constraining the allocation process to avoid sign reversal, the extended transfer algorithm ensures robustness and optimality of allocation, even under repeated directional flips or arbitrage scenarios.
Practically, the algorithm's compatibility with on-chain computations (e.g., via Uniswap V3 APIs) allows for efficient exploitation of arbitrage and better routing in fragmented liquidity environments. The implementation demonstrates high efficiency, scalability, and applicability to real-world DeFi venues.
Theoretically, concave continuation enables a straightforward extension to multi-hop routing scenarios, although the correct assignment of trade direction and sign-flipping between intermediate tokens remains an open problem. Future research might generalize the algorithm to handle multi-token routing and dynamic liquidity, further improving capital efficiency and arbitrage detection in decentralized finance.
Conclusion
The paper rigorously constructs the concave continuation of AMM trade functions, unifying routing and arbitrage into a single concave optimization problem. The extended transfer algorithm is efficient, robust against allocation sign-crossing, and empirically validated both in simulation and on-chain contexts. The approach lays foundational groundwork for advanced routing protocols in DeFi, with direct implications for both practical arbitrage exploitation and theoretical optimization, and opens avenues for future multi-hop routing research in AMMs.