🤖 AI Summary
Existing research lacks formal state-machine modeling of concentrated-liquidity automated market makers (CLAMMs) such as Uniswap v3, hindering model checking and theorem proving. This paper introduces the first verifiable state-machine model grounded in pricing timed automata (PTA) and finite-state transducers (FST): PTA captures continuous price evolution and fee accumulation, while FST abstracts discrete tick-level behavior within TLA+. We propose tick-level invariants with compact rounding bounds, establishing a theoretical foundation for ε-relaxation and enabling formal verification of cross-tick behavior and rounding safety. Using UPPAAL for modeling and TLC for exhaustive model checking, we validate structural fidelity, rounding bounds for zero-fee swaps, and arbitrage-freeness in bidirectional single-tick models across diverse tick configurations.
📝 Abstract
Concentrated-liquidity automated market makers (CLAMMs), as exemplified by Uniswap v3, are now a common primitive in decentralized finance frameworks. Their design combines continuous trading on constant-function curves with discrete tick boundaries at which liquidity positions change and rounding effects accumulate. While there is a body of economic and game-theoretic analysis of CLAMMs, there is negligible work that treats Uniswap v3 at the level of formal state machines amenable to model checking or theorem proving.
In this paper we propose a formal modeling approach for Uniswap v3-style CLAMMs using (i) networks of priced timed automata (PTA), and (ii) finite-state transducers (FST) over discrete ticks. Positions are treated as stateful objects that transition only when the pool price crosses the ticks that bound their active range. We show how to encode the piecewise constant-product invariant, fee-growth variables, and tick-crossing rules in a PTA suitable for tools such as UPPAAL, and how to derive a tick-level FST abstraction for specification in TLA+.
We define an explicit tick-wise invariant for a discretized, single-tick CLAMM model and prove that it is preserved up to a tight additive rounding bound under fee-free swaps. This provides a formal justification for the "$ε$-slack" used in invariance properties and shows how rounding enters as a controlled perturbation. We then instantiate these models in TLA+ and use TLC to exhaustively check the resulting invariants on structurally faithful instances, including a three-tick concentrated-liquidity configuration and a bounded no-rounding-only-arbitrage property in a bidirectional single-tick model. We discuss how these constructions lift to the tick-wise structure of Uniswap v3 via virtual reserves, and how the resulting properties can be phrased as PTA/TLA+ invariants about cross-tick behaviour and rounding safety.