I Built a Prediction Market Bot That Trades Itself
I built an autonomous prediction market trading bot that continuously monitors Polymarket, identifies pricing inefficiencies, and executes trades without human intervention.
Architecture
The bot runs on a VPS with a persistent Python process managed by systemd. It uses the Polymarket API for market data and order execution, with Redis for state management and SQLite for trade history.
# systemd service [Unit] Description=PolyX Trading Bot After=network.target [Service] Type=simple User=ubuntu WorkingDirectory=~/polyx-bot ExecStart=~/polyx-bot/venv/bin/python bot.py Restart=always RestartSec=10 [Install] WantedBy=multi-user.target
Strategy
The bot uses a mean-reversion approach on binary markets with high liquidity:
- Monitor price deviations from historical baselines
- Check for stale prices on low-volume markets
- Calculate position sizing based on Kelly criterion
- Execute limit orders with tight spreads
Pros
- 24/7 operation without fatigue
- Disciplined position sizing
- Faster reaction to market moves
Cons
- API rate limits
- Overfitting to historical data
- Requires careful risk management
Results
Over 30 days of live trading, the bot achieved a 4.2% ROI with 187 trades executed. Drawdown was kept under 2% through strict position limits. The biggest lesson: latency matters less than edge detection in prediction markets.
Key Takeaways
- Start with paper trading or very small amounts
- Prediction markets are less efficient than commonly believed
- Infrastructure reliability is as important as strategy
- Regulatory uncertainty remains the biggest risk
Repository: github.com/rommark/PolyX
Documentation: polyx.rommark.dev