

Case Study: How The Graph Powers Theoriq’s AI Agent Swarms to Reinvent DeFi Liquidity
is building a new class of intelligent onchain agents designed to make DeFi smarter, faster, and more efficient. At the heart of its protocol is a decentralized network of AI swarms—coordinated agents that optimize liquidity, reduce risk, and improve capital efficiency. Powered by real-time data from Substreams, Theoriq is setting a new benchmark for automation in decentralized finance.
The Vision: Real-Time AI Coordination
Theoriq’s agents act directly onchain, executing trades, provisioning liquidity, and rebalancing positions based on live market conditions. But for these agents to function autonomously, they need fast, structured data from the chain. That’s where Substreams came in.
“Integrating Substreams into the Theoriq Protocol gives our agents direct access to clean, real-time onchain data—powering their ability to make fast, intelligent financial decisions.” —Ethan Jackson, Co-Founder and Head of Research at Theoriq
The Challenge: Visibility Into Pool State
Theoriq’s first live system, the Onchain Liquidity Provisioning (OLP) Swarm, aimed to optimize Uniswap V3 positions on Base. But early attempts were blocked by a lack of real-time visibility into pool states. Legacy solutions couldn’t decode liquidity events or reflect state changes quickly enough.
Without a performant indexing solution, real-time optimization strategies weren’t just difficult, they were infeasible.
The Solution: Substreams as Real-Time Infrastructure
Substreams, a parallelized streaming engine, provided the backbone Theoriq needed:
- Live, decoded data from Uniswap V3 on Base
- Granular event tracking like balance changes, mints, burns, and swaps
- Direct SQL output feeding Theoriq’s Observer Agent
Inside the Swarm: Observer Agents
The “Observer Agent” consumes Substreams data in real time, triggering downstream actions like LP rebalancing or trade execution. This enabled:
- Instant reactions to pool activity
- Dynamic optimization of LP positions
- Autonomous execution of high-confidence strategies
This architecture gave Theoriq exactly what they needed: a fast, deterministic data layer to anchor their decision-making logic.
Key Results
Substreams didn’t just make the OLP Swarm possible. It laid the groundwork for Theoriq’s future roadmap.
- Time-to-market for new liquidity pool support went from weeks to days
- 70% reduction in infrastructure costs
- 100% data accuracy in PoC testing
- Lightweight infra footprint to operate real-time agents
Why It Matters
Traditional DeFi tooling can’t match the pace of modern markets. Manual rebalancing and RPC scraping are slow, expensive, and incomplete. Theoriq’s agents bring the intelligence. bring the infrastructure.
Together, they’re building native, autonomous financial participants that make DeFi liquidity work smarter.
What’s Next
Theoriq is expanding to more liquidity pools and deploying new AI agents using the same Substreams-powered data pipeline. With this modular foundation, new swarms can be launched quickly—fueling rapid experimentation and protocol growth.
Want to build intelligent agents that act on real-time blockchain data?
and stream data at scale with Substreams on The Graph.
About The Graph
is the leading indexing and query protocol powering the decentralized internet. Launched in 2018, it has enabled tens of thousands of developers to effortlessly build and across countless blockchains, including Ethereum, Solana, Arbitrum, Optimism, Base, Polygon, Celo, Soneium, and Avalanche.
Discover more about how The Graph is shaping the future of decentralized physical infrastructure networks (DePIN) and stay connected with the community. Follow The Graph on , , , , , and . Join the community on The Graph’s , join technical discussions on The Graph’s .
oversees The Graph Network. , , , , and are seven of the many organizations within The Graph ecosystem.