Agentic BeesTrap

Autonomous AI-driven MEV defense for Uniswap v4 leveraging verifiable ZK-ML hooks.

Agentic BeesTrap

Created At

HackMoney 2026

Project Description

Agentic BeeTrap is an autonomous security layer designed to transform how Liquidity Providers (LPs) defend against predatory MEV on Uniswap v4. Currently, LPs suffer from "invisible taxes" like sandwich attacks that drain liquidity and discourage long-term participation. BeeTrap shifts the paradigm from passive vulnerability to active, agentic defense.

The system acts as a digital sentinel that monitors transaction flows in real-time, identifying malicious intent before it impacts the pool. Unlike static blacklists, BeeTrap uses agentic intelligence to adapt to evolving bot behaviors across multiple chains. By leveraging dynamic fee adjustments, it doesn't just block attackers; it "traps" them by redirecting their intended profit back to the liquidity providers. This creates a sustainable economic model where security directly enhances protocol revenue and LP yield, making decentralized markets more resilient and profitable.

How it's Made

This project is built on a modular architecture connecting off-chain intelligence with on-chain enforcement. The core is the Sentinel, a high-performance engine written in Rust that utilizes the Alloy stack for sub-millisecond mempool streaming and interaction. For the "Brain," we implemented a custom-trained machine learning model (XGBoost/MLP) exported via ONNX for localized, high-speed inference.

On the blockchain, we utilized Uniswap v4 Hooks to execute the dynamic "trap" logic during the swap lifecycle. Identity and authority are managed through an ERC-721 (Agent NFT) and a custom ERC-8004 Validation Registry.

A particularly notable "hacky" but robust implementation is our Hybrid Validation approach: we use ECDSA signatures for instant, low-latency defense in the mempool race, but the registry is architected to be "future-proof" with specific slots for EZKL-based ZK-ML proofs. This ensures that every detection signal can eventually be verified as computationally honest without compromising speed. We also built a custom data pipeline to synthesize cross-chain bot patterns from Dune Analytics to ensure our agent is chain-agnostic.

background image mobile

Join the mailing list

Get the latest news and updates