Sentinel Agent

AI-powered, MEV-resistant autonomous liquidity manager for Uniswap v4.

Sentinel Agent

Created At

HackMoney 2026

Project Description

Sentinel Agent is an autonomous, MEV-resistant liquidity management protocol built on Uniswap v4. It fundamentally addresses the critical "Loss-Versus-Rebalancing" (LVR) problem, which costs AMM liquidity providers roughly 5-7% annually due to stale pricing and arbitrage leakage. Unlike standard dynamic fee models, Sentinel employs a novel three-layer architecture to demonstrate true Agentic Finance:

  1. The Manager Hook (On-Chain): Acting as a trust boundary, this sophisticated hook utilizes flash accounting to capture arbitrage profits (MEV) via top-of-block auctions before they leak to external searchers. It then redistributes this value directly to LPs via internal donations. 2.The Agent Swarm (Off-Chain): Secure AI agents running in TEEs (Phala Network) monitor market volatility and generate ZK-ML proofs (Brevis) to predictively optimize fee tiers and liquidity ranges based on real-time data. 3.The Verification Bridge: Every economic decision generated by the swarm carries a cryptographic attestation. The hook verifies this signature before execution, ensuring the pool is managed by verifiable, non-speculative code rather than human operators.

By combining verifiable off-chain intelligence with transparent on-chain execution, Sentinel Agent transforms AI from a passive observer into a first-class economic actor that actively protects and grows on-chain capital.

How it's Made

Sentinel Agent is architected as a hybrid on-chain/off-chain system, bridging Uniswap v4 hooks with an autonomous Node.js agent swarm. The On-Chain Layer (Solidity & Foundry): We built SentinelHook inheriting from BaseHook, implementing a custom dynamic fee engine. The core innovation lies in the beforeSwap callback, which decodes hookData containing cryptographically signed instructions from our off-chain agents. We utilized HookMiner in Foundry to brute-force a salt that produced a contract address with the specific flags 0x4840, granting us permission to intercept beforeSwap, afterSwap, and beforeAddLiquidity calls. We also implemented an AgentRegistry based on ERC-8004 principles to manage agent identities and reputation scores on-chain.

The Off-Chain Swarm (Node.js & Ethers.js): The agent system is modularized into three distinct entities:

  1. Statistical Agent: Monitors real-time price spreads between Binance (CEX) and the Sepolia pool, calculating implied volatility and liquidity depth.
  2. Policy Agent: Acts as the risk engine, validating statistical data against safety bounds (e.g., max fee change per block) and signing authorization messages.
  3. Execution Agent: Encodes the signed instructions into the hookData field and manages transaction submission.

Notable & "Hacky" Implementations: To close the feedback loop without expensive on-chain queries, we engineered a semantic event system where the hook emits MarketHealth events (volatility index, imbalance ratio) in afterSwap. The agents listen to these specific events to trigger immediate recalculations for the next block. For the hackathon, we simulated the Trusted Execution Environment (TEE) attestation layer using standard ECDSA signatures from authorized agent wallets, proving the concept of verifiable off-chain intelligence controlling on-chain liquidity.

background image mobile

Join the mailing list

Get the latest news and updates

Sentinel Agent | ETHGlobal