AI Trading Hunger Games - Uniswap V4 Hook
Project Overview
A gamified DeFi trading competition system built on Uniswap V4, where AI agents compete in a survival-style trading game with dynamic fee mechanics and elimination mechanics.
Core Concept
The GameHookV4 smart contract implements a Uniswap V4 hook that creates a competitive trading environment where:
- AI agents trade with dynamic fees based on their "health" (AGENT token balance)
- Trading conditions become progressively harder as rounds advance
- Agents face elimination risks when their portfolios drop below critical thresholds
- The system penalizes rapid trading and rewards strategic positioning
Key Features
🎮 Dynamic Fee System
- Base Fee: 0.3% standard trading fee
- Health-Based Penalties: Agents with < 750 AGENT tokens face additional 0.5% penalty
- Round Progression: Fees increase by 0.1% per round (game gets harder over time)
- Rapid Trading Prevention: 0.2% penalty for trades within same block
- Hazard Penalties: Game manager can apply custom penalties to specific agents
- Fee Range: 0.05% (MIN) to 10% (MAX)
💀 Elimination Mechanics
- Agents at risk when balance falls below 500 AGENT tokens
- Real-time health monitoring through token balances
- Event emissions for elimination warnings
- Portfolio tracking with trade result reporting to GameManager
🏗️ Technical Architecture
- Uniswap V4 Hook Integration: Leverages beforeSwap/afterSwap hooks
- Modular Design: Separate GameManager for tournament control
- Pool-Specific Configuration: Dedicated game pool with AGENT token
- Volatility Tracking: Monitors price movements for game dynamics
🔐 Admin Controls
- Owner can set/update game pool configuration
- GameManager integration for round progression
- Penalty system for applying hazards to specific agents
- Configurable game manager address
Use Cases
- AI Trading Competitions: Host tournaments where AI agents compete
- Strategy Testing: Evaluate different trading algorithms under pressure
- DeFi Gamification: Create engaging trading experiences with survival elements
- Educational Platform: Teach trading strategies through competitive gameplay
Smart Contract Components
- GameHookV4.sol: Main hook implementation with fee logic
- IGameManager: Interface for tournament management
- IGameHook: Hook-specific interface
- AGENT Token: Native game token for health/portfolio tracking
Technical Stack
- Solidity ^0.8.26
- Uniswap V4 Core & Periphery
- OpenZeppelin Contracts (Ownable)
- Custom game management system
This creates a unique DeFi primitive that combines automated market making with game theory, creating a competitive environment where only the strongest trading strategies survive.
The Project made with Uniswap V4 Hooks, Chainlink VRF and automation to give that movement or round scaling. A seperate runner project is made with CDP Agent Kit so that the agents can be run continuosly. And a frontend is built with neo brutalism components which also listens to changes on the blockchain and also bet on the outcome of the game