mirror of
https://github.com/saymrwulf/alpha-arena.git
synced 2026-07-12 17:46:43 +00:00
Polymarket Autonomous Trading Harness - Multi-agent AI trading system with LLM flexibility and native macOS app
A comprehensive autonomous trading system for Polymarket prediction markets featuring multi-LLM provider support, a native macOS menu bar app, and a web-based control dashboard. Key features: - Multi-agent trading system (Research, Risk, Execution, Reflection agents) - LLM provider flexibility (Anthropic, OpenAI, Google, xAI, Local models) - Automatic provider fallback chain for resilience - Native Swift/SwiftUI macOS menu bar application - FastAPI web dashboard with real-time WebSocket updates - Risk management with kill switch - Technical indicators and market analysis |
||
|---|---|---|
| docs | ||
| macos-app | ||
| scripts | ||
| src | ||
| tests | ||
| .env.example | ||
| .gitignore | ||
| AI trading in real markets.webarchive | ||
| alpha | ||
| cli.py | ||
| config.example.yaml | ||
| pyproject.toml | ||
| QUICKSTART.md | ||
| README.md | ||
| requirements.txt | ||
| start | ||
Alpha Arena
Autonomous trading system for Polymarket prediction markets
Single objective: maximize PnL
Start in 10 Seconds
./alpha start
Then open http://localhost:8000
That's it. Everything runs in the background with macOS notifications.
Daily Commands
| Command | What it does |
|---|---|
./alpha start |
Start server (background, notifies when ready) |
./alpha stop |
Stop server (graceful shutdown) |
./alpha status |
Check if running |
./alpha logs |
Watch live logs |
./alpha open |
Open web UI in browser |
See QUICKSTART.md for the complete command reference.
What You Get
Web Control Center
Real-time dashboard at localhost:8000 with:
- Live P&L and positions
- Start/stop trading controls
- Market browser and analysis
- Risk management settings
- Decision logs and metrics
Multi-Agent Trading
Four specialized AI agents collaborating:
- Research - Market analysis, probability estimation
- Risk - Position sizing with Kelly Criterion
- Execution - Optimal order timing
- Reflection - Learning from outcomes
Safety First
- Kill switch for emergency stop
- Daily loss limits
- Position size caps
- Simulation mode for testing
Requirements
- Python 3.11+ (tested with 3.14)
- macOS, Linux, or WSL
- At least one LLM API key (Anthropic, OpenAI, or xAI)
First-Time Setup
The ./alpha start command handles setup automatically. For manual control:
# 1. Run setup
./scripts/setup.sh
# 2. Add your API keys
nano .env
# 3. Verify everything works
./scripts/check.sh
# 4. Start
./alpha start
Required API Keys
Add to .env:
# At least one LLM provider
ANTHROPIC_API_KEY=sk-ant-...
# or
OPENAI_API_KEY=sk-...
# For live trading (optional)
POLYMARKET_API_KEY=...
POLYMARKET_API_SECRET=...
POLYMARKET_PASSPHRASE=...
Architecture
┌────────────────────────────────────────────────────────┐
│ Web Application (FastAPI) │
│ Dashboard | Trading | Markets | Logs │
└───────────────────────┬────────────────────────────────┘
│
┌─────────────┼─────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Trading │ │ Agent │ │ Risk │
│ Loop │ │ System │ │ Manager │
└──────────┘ └──────────┘ └──────────┘
│ │
▼ ▼
┌──────────┐ ┌──────────┐
│ Broker │ │ LLM │
│Polymarket│ │ Providers│
└──────────┘ └──────────┘
Project Structure
alpha-arena/
├── alpha # Master control script
├── QUICKSTART.md # Daily command reference
├── scripts/
│ ├── setup.sh # First-time setup
│ ├── check.sh # System diagnostics
│ └── test.sh # Run tests
├── src/
│ ├── web/ # Web application
│ ├── broker/ # Market execution
│ ├── agent/ # AI agents
│ ├── risk/ # Risk management
│ └── metrics/ # Logging
├── tests/ # Test suite (170+ tests)
├── docs/ # Detailed documentation
├── .venv/ # Isolated Python (auto-created)
└── data/ # Runtime data (auto-created)
Documentation
| Document | Purpose |
|---|---|
| QUICKSTART.md | Daily commands, quick reference |
| docs/WEB_APP_MANUAL.md | Web interface guide |
| docs/USER_MANUAL.md | Full CLI and API reference |
| docs/TESTING.md | Testing guide |
Troubleshooting
Server won't start
./scripts/check.sh --fix
Missing dependencies
./scripts/setup.sh
API key issues
Check .env has valid keys, then restart.
Something else broke
./alpha logs # See what's happening
./alpha status # Check process status
Isolation
Everything runs in complete isolation:
.venv/- Python packages (nothing global)data/- All runtime data.env- Your configuration
Uninstall completely by deleting the folder.
License
MIT
Disclaimer
This software is for educational purposes. Trading prediction markets involves financial risk. Past performance does not guarantee future results. Use at your own risk.