Event-driven Polymarket copy-trading bot with Electron dashboard and MCP server.
┌─────────────────────────────────────────────────────────────┐
│ ELECTRON DASHBOARD (Windows native) │
│ Status │ Roster │ Trade Feed │ PnL Chart │ Research Queue │
└──────────────────────┬──────────────────────────────────────┘
│ reads SQLite (C:\polybot\polybot.db)
┌──────────────────────▼──────────────────────────────────────┐
│ SQLITE DATABASE │
│ traders │ trades │ bot_config │ pnl_snapshots │ candidates │
└─────┬────────────────────────────────────┬──────────────────┘
│ writes │ reads/writes
┌─────▼──────────┐ ┌──────────▼─────────────────┐
│ BOT ENGINE │ │ MCP SERVER │
│ (WSL2 Python) │ │ (WSL2 Python FastMCP) │
│ │ │ 40+ agent-callable tools │
│ research loop │ └────────────────────────────┘
│ tracker feed │
│ trade copier │
│ roster manager │
│ auto-redeemer │
└─────┬──────────┘
│ subprocess (--output json)
┌─────▼──────────┐
│ BULLPEN CLI │
│ (WSL2 binary) │
└────────────────┘
- Windows PC with WSL2 (Ubuntu)
- Python 3.11+ (inside WSL2)
- Node.js 20+ (Windows, for Electron dashboard)
- Bullpen CLI authenticated (
bullpen login) - GitHub CLI authenticated (
gh auth login)
# Clone the repo
git clone https://github.com/djd39448/polybot.git
cd polybot
# Set up Python environment
cd bot
python3.11 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
# Configure environment
cp .env.example .env
# Edit .env with your Bullpen binary path and preferences
# Create the shared database directory
mkdir -p /mnt/c/polybot
# Run tests
pytest
# Start the bot (paper mode by default)
python -m engine.botcd electron
npm install
npx electron-rebuild # Required for better-sqlite3
npm run dev| Component | Technology |
|---|---|
| Bot Engine | Python 3.11, asyncio, aiosqlite |
| CLI Interface | Bullpen CLI (subprocess, --output json) |
| Database | SQLite (WAL mode, shared file) |
| MCP Server | Python FastMCP (mcp>=1.0.0) |
| Dashboard | Electron + React 18 + TypeScript + Tailwind + shadcn/ui |
| Charts | Recharts |
| Linting | ruff (Python), eslint + prettier (TS) |
| Testing | pytest + pytest-asyncio, Vitest |
- Research — Daily leaderboard polling scores traders on 180-day return rate, recency, and market diversity
- Roster — Top 10 traders fill 5 live slots and 5 paper slots, with weekly promotion/demotion
- Tracking — Polls Bullpen tracker feed for new trades from rostered traders
- Execution — Copies trades at a fixed dollar amount ($5 default) with cash reserve and slippage guards
- Redemption — Auto-redeems resolved winning positions every 5 minutes
polybot/
├── bot/ # All WSL2 Python code
│ ├── core/ # Config, Bullpen wrapper, logging
│ ├── database/ # Schema, migrations, async DB access
│ ├── research/ # Leaderboard polling, trader scoring
│ ├── engine/ # Bot loop, trade execution, roster, redeemer
│ ├── mcp_server/ # FastMCP server (40+ tools)
│ └── tests/ # Full pytest suite
├── electron/ # Windows Electron dashboard
│ └── src/
│ ├── main/ # Electron main process + better-sqlite3
│ └── renderer/ # React UI with 7 panels
├── docs/ # Architecture, MCP tools, setup guides
└── .github/workflows/ # CI: lint + test on push
MIT