ROOK is a modular trading agent we built for Uniswap v4 that separates decision-making from execution. The idea is simple: instead of a fixed trading bot, ROOK lets us plug in different AI models — whether they’re pretrained, fine-tuned, or experimental — as the “brain,” while the rest of the system handles execution and portfolio tracking. This makes it easy to test, compare, and evolve trading strategies: the brain focuses on deciding, the executor reliably carries out trades, and the portfolio tracks performance, giving us a flexible playground for building and improving AI-driven DeFi trading agents.
Architecture
- Multi-agent DeFi trading system with autonomous trading agents (ROOKs)
competing on-chain
- Python backend with modern dependency management using uv
- React/Three.js 3D frontend for cosmic trading visualization
- Blockchain integration via Web3.py and Uniswap v4
Core Components
Backend (Python):
- maharook/agents/rook/ - ROOK trading agents with Brain, Portfolio, Executor
modules
- maharook/blockchain/ - Web3 blockchain client integration
- maharook/core/ - Configuration management and agent registry
- Composition-based agent architecture combining Brain (AI decision making),
Portfolio (state tracking), Executor (trade execution)
Frontend (React/Three.js):
- 3D cosmic trading arena using @react-three/fiber and @react-three/drei
- Real-time WebSocket connections for live trading data
- Components: TradingArena, AgentOrb, TradingFloor visualizations
AI/ML Training:
- LoRA fine-tuning scripts for financial models (fin-r1, qwen25)
- Synthetic data GAN and Wavelet Transformer DDPM
- Training data processing and model deployment pipelines
- Remote GPU training infrastructure setup
Key Technologies:
- Python 3.11+ with Pydantic for configuration management
- Web3.py for Ethereum/Base blockchain interactions
- PyTorch + Transformers for AI model training/inference
- FastAPI + WebSockets for real-time communication
- Three.js for 3D trading visualizations
The project follows modern Python practices with strict typing, fail-fast
design principles, and comprehensive testing infrastructure.