Polymarket Arbitrage Bot
A high-performance, type-safe arbitrage engine for Polymarket - built in Node.js + TypeScript.
Detects and executes on YES/NO mispricings, crypto Up/Down markets (BTC, ETH, SOL), and cross-venue inefficiencies in real time.
|
Live Dashboard UI |
Performance & Opportunities |
Table of Contents
- Why This Bot
- Features
- Tech Stack
- Architecture
- Quick Start
- Configuration
- Strategies
- Risk Management
- Performance & Transparency
- Roadmap
- Contributing
- Disclaimer
- License
Why This Bot
Prediction markets like Polymarket move fast, and pricing inefficiencies between YES/NO legs - or between Polymarket and other venues - tend to close within seconds. This project exists to make that detection-and-execution loop fast, observable, and safe to operate, instead of relying on manual monitoring or fragile scripts.
It's built around three principles:
| Principle | What it means in practice |
|---|---|
| Speed | Async WebSocket pipelines, no polling where a stream is available |
| Safety | Explicit exposure limits, slippage guards, and kill-switches before execution |
| Transparency | Every trade, signal, and skipped opportunity is logged and inspectable |
Features
- Real-Time Arbitrage Scanner - continuously monitors Polymarket 5-minute Up/Down contracts and other markets for pricing mismatches.
- Low-Latency Execution Engine - async/await pipelines, persistent WebSocket connections, and optimized RPC batching.
- Modular Strategy System:
- Intra-market arbitrage (YES/NO parity breaks)
- Cross-venue price discrepancies
- Short-term momentum on crypto Up/Down markets
- Merge/redeem liquidity optimizer
- Built-In Risk Management - position sizing, stop logic, slippage protection, and configurable per-market exposure caps.
- Multi-Channel Alerts - Telegram, Discord, or custom webhooks for fills, errors, and opportunity alerts.
- Live Dashboard - optional Express + WebSocket UI for real-time P&L, open positions, and opportunity feed.
- Type-Safe End to End - Zod-validated inputs/outputs across the entire pipeline, so bad data fails loud, not silent.
Tech Stack
| Layer | Technology |
|---|---|
| Runtime | Node.js 20+ |
| Language | TypeScript |
| Blockchain | ethers.js / viem |
| Market data | Polymarket SDK, REST + WebSocket |
| Queuing | BullMQ |
| Logging | Winston |
| Validation | Zod |
| Dashboard | Express + WebSocket |
Architecture
┌─────────────────┐ ┌──────────────────┐ ┌───────────────────┐
│ Market Data │────▶│ Signal Engine │────▶│ Risk Manager │
│ (WS + REST) │ │ (strategies) │ │ (sizing/limits) │
└─────────────────┘ └──────────────────┘ └─────────┬─────────┘
│
┌──────────────────┐ ▼
│ Notifications │◀────┌───────────────────┐
│ (TG/Discord/Hook)│ │ Execution Engine │
└──────────────────┘ │ (ethers/viem) │
└───────────────────┘
Quick Start
git clone https://github.com/emreatak0/polymarket-arbitrage-bot-btc-5m.git
cd polymarket-arbitrage-bot
npm install
cp .env.example .env
npm run build
npm run startRun in dry-run / paper mode first (see Configuration) before connecting a funded wallet.
Configuration
Set these in your .env file:
# Wallet & network
PRIVATE_KEY=your_wallet_private_key
RPC_URL=https://polygon-rpc.com
# Notifications
TELEGRAM_BOT_TOKEN=...
TELEGRAM_CHAT_ID=...
# Risk controls
MAX_POSITION_USD=500
MAX_DAILY_LOSS_USD=100
DRY_RUN=trueNever commit your .env file or share your private key. Consider using a dedicated, minimally-funded wallet for bot operations rather than a primary wallet.
Strategies
| Strategy | Description |
|---|---|
| 5-Min Up/Down Arb | Core focus on BTC/ETH/SOL short-duration contracts |
| YES/NO Price Discrepancy | Classic arbitrage when YES + NO < $1 |
| Cross-Platform | Compares Polymarket pricing against other venues |
| Statistical / Momentum | Pluggable custom signal layer |
| Liquidity Optimization | Automated merge/redeem to free up capital |
Each strategy is a self-contained module - enable, disable, or tune thresholds independently in config/strategies.ts.
Risk Management
- Configurable max position size and max daily loss limits
- Slippage protection on every execution path
- Stop logic to halt trading on abnormal market conditions or repeated failed fills
- Dry-run mode to validate strategy behavior with zero capital at risk
Performance & Transparency
- Historical run logs are stored in
/resultsfor independent review. - On-chain wallet activity can be tracked directly on Polygonscan for full transparency - no black-box claims.
- Results vary by market conditions, latency, and configuration; past logs are not a guarantee of future performance.
Author's Track Record
Rather than quoting a P&L screenshot that goes stale the moment markets move, the maintainer's live Polymarket activity is public and verifiable in real time:
- Polymarket profile: polymarket.com/@ratue - live positions, P&L, and trade history
- Twitter/X: @dontoverfit - build updates, strategy notes, and market commentary
These links show real, current on-chain activity rather than a fixed number in this README - check them directly for up-to-date performance.
Snapshot (as of July 8, 2026):
| Metric | Value |
|---|---|
| Predictions made | 33,753 |
| Positions value | $876.57 |
| Biggest win | $2,036.37 |
| P&L (past day) | +$935.53 |
| Profile views | 22.7K |
This table is a point-in-time snapshot and will not update automatically. For current figures, always check the live profile.
Roadmap
- Advanced ML signals (TensorFlow.js or external model integration)
- Rust core for ultra-low-latency execution
- Expanded market support (politics, sports, perps)
- Docker + Kubernetes deployment
- Public API for community-contributed strategies
Contributing
Contributions are welcome. Open an issue or PR for new strategies, bug fixes, or performance improvements. Please include tests and a clear description of the change.
Questions, feedback, or strategy ideas - reach out on X/Twitter or check out live trading activity on Polymarket.
Disclaimer
Automated trading on prediction markets carries substantial risk of loss, including total loss of deployed capital. Smart contract, liquidity, and execution risks all apply. This project is provided as-is, with no guarantee of profitability. This is not financial advice. Start with small sizes, use dry-run mode first, and do your own research.
License
MIT License - free to use and modify with attribution.
Keywords: polymarket arbitrage bot · polymarket arb bot · polymarket trading bot typescript · node.js polymarket bot · prediction market arbitrage · crypto up/down bot · polymarket automation · defi arbitrage bot