State Twins: An Off-Chain Substrate for Agentic Reasoning over Decentralized Finance Protocols
Ian C. Moore

TL;DR
The paper introduces the State Twin, an off-chain replica of DeFi AMM pools that enables agentic reasoning, backtesting, and analysis without on-chain constraints, improving flexibility and speed.
Contribution
It formalizes the State Twin as an off-chain substrate for DeFi protocols, enabling replay, branching, and counterfactual analysis while maintaining mathematical fidelity.
Findings
Proves fidelity bounds between twin and on-chain states.
Demonstrates sub-second replay of multiple scenarios.
Provides an open-source Python toolkit for DeFi analysis.
Abstract
We introduce the State Twin: a typed, in-memory, replayable replica of an on-chain automated market maker (AMM) pool that serves as a substrate for agentic reasoning over decentralized finance (DeFi) protocols. Agentic DeFi stacks today couple reasoning to chain time, since every "what if?" query incurs a new RPC read or a real transaction, so the agent's effective action space is bounded by block confirmation latency and gas. We argue this coupling is a structural problem rather than a performance one, and that the missing layer is an off-chain substrate that preserves the protocol's exact mathematics while admitting the operations on-chain state cannot: forking, replay, branching, counterfactual rollout. We formalize each AMM family (Uniswap V2, V3, Balancer, Stableswap) as a discrete-time controlled dynamical system, prove a quantitative fidelity bound on the divergence between twin…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
