Sentinel

Sentinel Protects Liquidity Pools ahead of MEV with Uniswap v4 hooks and agent monitoring.

Sentinel

Created At

HackMoney 2026

Project Description

Sentinel: Autonomous MEV Defense for Uniswap v4 Liquidity Providers Sentinel is a decentralized agent network that protects liquidity providers on Uniswap v4 from sophisticated MEV (Maximal Extractable Value) attacks. The system combines real-time mempool monitoring with Uniswap v4's innovative hook architecture to detect and prevent value extraction before it happens. How It Works: The platform operates through a distributed keeper network that continuously monitors blockchain mempool activity for suspicious patterns indicative of MEV attacks—including sandwich attacks, JIT (Just-In-Time) liquidity exploits, and abnormal velocity spikes. When a potential threat is detected, Sentinel triggers a custom Uniswap v4 hook that can dynamically adjust pool parameters, such as raising swap fees or temporarily pausing trades for a single block, effectively neutralizing the attack. Key Features:

Multi-Layer Protection: Implements velocity limits, progressive fee structures, and on-chain challenge enforcement to create a robust defense system

Real-Time Response: Keeper network operates 24/7 with 12-second block synchronization to respond to threats instantly

Decentralized Coordination: No single point of failure—distributed keepers reach consensus on threat detection

Economic Alignment: Reputation-weighted reward system incentivizes accurate threat detection and discourages false positives

Technical Architecture:

The project consists of three core components: a Next.js dashboard for monitoring pool defenses and network activity, a TypeScript-based sentinel agent that watches the mempool and coordinates guardian transactions, and Uniswap v4 hook contracts that execute protective measures on-chain. This architecture ensures that protection happens at the protocol level, making it impossible for attackers to bypass. Sentinel represents a new paradigm in DeFi security—moving from reactive protection to proactive, autonomous defense that keeps liquidity providers ahead of increasingly sophisticated MEV strategies.

How it's Made

How It's Made: Building Sentinel's Autonomous MEV Defense System Sentinel is built as a full-stack DeFi protection platform combining smart contracts, autonomous agents, and a modern web interface—all orchestrated to defend Uniswap v4 liquidity providers from MEV attacks in real-time.

Smart Contract Layer Built HookdGuardMVP.sol using Solidity and Foundry framework Leveraged Uniswap v4's hook architecture with beforeSwap and afterSwap callbacks to intercept swaps at protocol level Implemented three defensive layers:

Velocity Protection: Surge pricing when pool volume exceeds 3x baseline in 10-block windows

Progressive Fees: Escalating costs (20% per swap) for frequent traders tracked via tx.origin

Challenge System: Decentralized governance with reputation-weighted keeper voting

Used CREATE2 for deterministic deployment (required for v4 hooks) Gas-optimized with packed structs and efficient storage patterns Deployed and verified on Sepolia testnet with full transaction history

Keeper Agent Network Built autonomous monitoring system in TypeScript with ethers.js v6 MempoolMonitor: WebSocket connection for real-time pending transaction monitoring MEVDetector: Analyzes transactions using 5 heuristics (gas price, swap size, frequency, timing, known bots) to calculate MEV confidence scores

ChallengeSubmitter: Auto-submits on-chain challenges when confidence exceeds 60% threshold Processes thousands of transactions per minute with sub-second detection

Frontend Dashboard Next.js 14 with App Router for optimal performance Multi-wallet support via WalletConnect, RainbowKit, and wagmi Five key views: landing page, dashboard, pools, keeper registration, challenge governance

Notable Technical Achievements

Dynamic Fee Calculation with Overflow Protection: Implemented sophisticated math to calculate surge fees, using careful ratio calculations and caps at 10% maximum.

Token Normalization Across Decimals: Built a price-aware normalization system that converts WETH (18 decimals) to USDC-equivalent (6 decimals) using sqrtPriceX96, ensuring consistent volume tracking regardless of token pair.

tx.origin Tracking: Used tx.origin instead of msg.sender to track actual users behind router contracts, enabling accurate per-user progressive fees.

Deterministic Hook Deployment: Leveraged CREATE2 for predictable hook addresses, critical for Uniswap v4's address-based permission system.

background image mobile

Join the mailing list

Get the latest news and updates