Skip to main content
Article
100%
HD

Uniswap v3 is the new face of decentralized markets: instead of a single price curve, users can concentrate liquidity in tiny intervals called “ticks”. Think of ticks as squares on a game board: each time the price crosses a square, your position turns on or off.

To check that everything works without glitches, researchers turned this mechanism into a formal state machine. They use two tools: priced timed automata (PTA) and finite‑state transducers (FST). PTAs act like robots that watch time and price, verifying that Uniswap’s rules – the constant‑product invariant, fees, and tick limits – are always respected. FSTs, on the other hand, simplify everything to discrete steps, making it easier to verify behavior with TLA+.

A key result is the tick‑wise invariant: even though swap operations round numbers, the error stays within a very tight bound, called “ε‑slack”. This means the system is robust: tiny inaccuracies don’t break the balance. The authors tested the models with UPPAAL and TLC, confirming that even in scenarios with three ticks or fee‑free arbitrage, the rules hold.

In practice, these models provide a mathematical proof that Uniswap v3 doesn’t “glitch” when the price jumps from one tick to another, making DeFi safer and more transparent.

Bonus
100%
HD

The proposed model starts from a formal representation of the Uniswap v3 pool as a network of priced timed automata (PTA). Each automaton corresponds to a tick interval and contains continuous variables for virtual reserves, the current price (expressed as sqrtPriceX96) and the global feeGrowth. Transitions are triggered by "tick‑crossing" events, i.e., when the price exceeds the upper or lower bound of an interval. During these transitions the feeGrowth variables are updated and the active/inactive liquidity rules are applied, preserving the constant‑product invariant (x·y = k) at the discrete level.

To make the model verifiable, the authors introduce a discretization of prices into tick units, turning continuous operations into finite steps. The result is a finite‑state transducer (FST) that maps sequences of ticks into sequences of reserve changes, allowing specification in TLA+. The tick‑wise invariant is proved by induction on each transition: starting from an initial state where the invariant holds, one shows that the reserve and fee updates introduce a rounding error ≤ ε, where ε is tied to the 128‑bit precision of sqrtPriceX96.

The rounding bound is tightly controlled thanks to the concept of "virtual reserves": real reserves are always a linear function of virtual reserves plus an offset determined by feeGrowth. This offset ensures that, even if swap operations introduce truncation errors, the difference between virtual reserves before and after the transaction stays within ε.

Experiments with UPPAAL verified the invariant on three‑tick configurations, showing that no sequence of swaps can violate the bound. Moreover, the TLA+ analysis with TLC confirmed the "no‑rounding‑only‑arbitrage" property: in the absence of fees, it is impossible to earn arbitrage profit by exploiting rounding errors alone. These results provide a solid theoretical foundation for the safety of CLAMMs, paving the way for further formal verification of more complex DeFi protocols.

Ask AI

Explore key aspects of this story with 3 quick insights

Source

Date Published:
Original Article arxiv.org
Fact-check verified on 16/01/2026 Primary Study / Original Source
Read our Editorial Guidelines & AI Ethics Policy
Creative Commons License CC BY-NC-SA 4.0

Keep exploring

Discover the full archive of science bites or head back to home

Riconnessione al server... Aggiornamento della sessione in corso
Connessione interrotta Impossibile stabilire il collegamento
Sessione aggiornata Ricarica per visualizzare i contenuti