# 1. Clone and setup
git clone <repo-url>
cd polymarket-ai-bot
# 2. Configure environment
cp .env.example .env
# Edit .env with your API keys
# 3. Deploy (dry-run mode by default)
./deploy.shSafe mode - analyzes markets but doesn't execute trades.
./deploy.sh
# or
docker compose -f probablyprofit/docker-compose.yml up -dDashboard: http://localhost:8000
Simulates trades with virtual money. Perfect for testing strategies.
./deploy.sh paperDashboard: http://localhost:8001
Configuration:
PAPER_CAPITAL=10000 # Starting virtual capitalREAL MONEY - Use with caution!
./deploy.sh liveRequires confirmation and valid:
PRIVATE_KEYfor Polymarket
Uses multiple AI providers for consensus-based decisions.
./deploy.sh ensembleRequires API keys for multiple providers (OpenAI, Anthropic, Google).
Historical simulation with synthetic data.
./deploy.sh backtestFor Polymarket:
PRIVATE_KEY=your_polygon_private_key
INITIAL_CAPITAL=1000.0For AI (at least one required):
OPENAI_API_KEY=sk-...
GOOGLE_API_KEY=...
ANTHROPIC_API_KEY=sk-ant-...# Web Dashboard
ENABLE_WEB_DASHBOARD=true
WEB_DASHBOARD_PORT=8000
# Data Persistence
ENABLE_PERSISTENCE=true
# Intelligence Layer (enhanced analysis)
PERPLEXITY_API_KEY=pplx-...
TWITTER_BEARER_TOKEN=...
REDDIT_CLIENT_ID=...
REDDIT_CLIENT_SECRET=...Override via environment or CLI:
| Variable | CLI Flag | Options |
|---|---|---|
PLATFORM |
--platform |
polymarket |
STRATEGY |
--strategy |
mean-reversion, momentum, value, contrarian, volatility, calendar, arbitrage, news, custom |
AGENT |
--agent |
openai, gemini, anthropic, ensemble, fallback |
INTERVAL |
--interval |
seconds between loops |
SIZING |
--sizing |
manual, fixed_pct, kelly, confidence_based, dynamic |
# Start (dry-run)
./deploy.sh
# Start (paper trading)
./deploy.sh paper
# Start (live trading)
./deploy.sh live
# Start (ensemble)
./deploy.sh ensemble
# Run backtest
./deploy.sh backtest
# Run locally (no Docker)
./deploy.sh local
# View logs
./deploy.sh logs
# Stop all services
./deploy.sh stop
# Build only
./deploy.sh build# Build image
docker compose -f probablyprofit/docker-compose.yml build
# Start specific profile
docker compose -f probablyprofit/docker-compose.yml --profile paper up -d
# View logs
docker compose -f probablyprofit/docker-compose.yml logs -f
# Stop
docker compose -f probablyprofit/docker-compose.yml down
# Shell into container
docker exec -it probablyprofit_bot /bin/bash# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Build frontend
cd frontend && npm install && npm run build && cd ..
# Run
python -m probablyprofit.main --dry-run --strategy mean-reversionprobablyprofit/
├── agent/ # AI agents (OpenAI, Gemini, Anthropic)
├── api/ # Platform clients (Polymarket)
├── backtesting/ # Historical simulation
├── intelligence/ # News & alpha signal sources
├── resilience/ # Retry, circuit breaker, rate limiter
├── risk/ # Risk management & position sizing
├── storage/ # SQLite persistence
├── trading/ # Paper trading engine
└── web/ # FastAPI + React dashboard
The web dashboard provides:
- Real-time status and P&L
- Position tracking
- Trade history
- Risk exposure analysis
- Arbitrage opportunity scanner
- Paper trading portfolio
# Check logs
docker compose -f probablyprofit/docker-compose.yml logs probablyprofit
# Rebuild
docker compose -f probablyprofit/docker-compose.yml build --no-cache- Verify API keys in
.env - Check rate limits (use
--interval 120for slower polling) - Enable fallback agent:
--agent fallback
# Rebuild frontend
cd frontend && npm run build && cd ..# Check API status
curl http://localhost:8000/api/status
# Check health endpoint
curl http://localhost:8000/health- NEVER commit
.envto version control - Use read-only volume mounts for
.envin Docker - Run as non-root user (default in Dockerfile)
- Start with
--dry-runalways