Polymarket copy trading bot is an automated trading system designed to replicate the trading strategies of successful Polymarket traders in real-time. A straightforward, high-speed copy trading bot for Polymarket, built with TypeScript for type safety and modern JavaScript features.
This bot monitors selected Polymarket wallets in real time and automatically mirrors their trades.
Perfect for users who want a simple, fast, and reliable copy-trading setup with the benefits of TypeScript's type safety and modern tooling.
polymarket-copy-bot/
│
├── src/
│ ├── main.ts
│ ├── config.ts
│ ├── api.ts
│ ├── polymarket_api.ts
│ ├── watcher.ts
│ ├── interpreter.ts
│ ├── sizing.ts
│ ├── executor.ts
│ ├── risk.ts
│ ├── strategy.ts
│ └── agent.ts
│
├── package.json
├── tsconfig.json
└── .env
- Auto Copy Trading — automatically replicates trades from a target Polymarket trader.
- Risk Controls — adjustable fetch intervals, retry limits, and timestamp filtering.
- Type Safety — full TypeScript support with compile-time type checking.
- Simple Configuration — all settings managed through a
.envfile andconfig.ts.
The bot continuously monitors target wallets: detects trades instantly, identifies the event, direction, and stake, executes mirrored trades within <150ms, and uses asynchronous processing for maximum speed.
Choose how the bot sizes your trades:
Proportional Mode:
YourStake = (YourBank / TraderBank) × TraderStake
Fixed Allocation Mode:
Always bet $X per trade
Includes:
- Min/max trade size
- Liquidity checks
- Event-level exposure limits
Copy multiple wallets at once.
You can set:
- Equal weights
- Custom weights
- Per-wallet limits
The bot will open/close positions in sync with each tracked wallet.
Built for reliability:
- No duplicate trades
- Automatic retries
- Handles Polymarket API interruptions
- Auto-exit when the original wallet exits the position
+------------------------------+
| Wallet Watcher |
| Real-time wallet tracking |
+--------------+---------------+
|
v
+------------------------------+
| Trade Interpreter |
| Detect event, direction, $ |
+--------------+---------------+
|
v
+------------------------------+
| Position Sizing Engine |
| Scale or fixed allocation |
+--------------+---------------+
|
v
+------------------------------+
| Trade Executor |
| Market/limit execution |
+--------------+---------------+
|
v
Polymarket API
- A tracked wallet buys "Biden wins MI" at 48%.
- Bot detects the trade instantly.
- Your sizing rule is applied (e.g., $25 fixed).
- The bot mirrors the trade within ~150 ms.
- When the wallet exits, your position closes automatically.
- Optional rule: the bot can automatically close your trade once it reaches X% profit, regardless of what the tracked wallet does.
- Max stake per event
- Daily/weekly exposure limits
- Liquidity filters
- Per-wallet exposure caps
- Automatic recovery
- Full trade log
- Node.js 18+ - Download from nodejs.org
- npm (comes with Node.js)
-
Clone the repository
git clone <repository-url> cd polymarket-copy-trading-bot
-
Install dependencies
npm install
-
Set up environment variables
- Create a
.envfile in the root directory - Add your configuration:
POLYMARKET_API=https://api.polymarket.com OPENAI_API_KEY=your_openai_api_key_here
- Create a
-
Configure wallets
- Edit
src/config.tsand update thewallets_to_trackarray with actual wallet addresses
- Edit
-
Run the bot
# Development mode npm run dev # Production mode npm run build npm start
npm run dev- Run in development mode with tsxnpm run build- Compile TypeScript to JavaScriptnpm start- Run the compiled JavaScriptnpm run watch- Watch mode (auto-rebuild on changes)npm run cli- Run CLI commands (see CLI_USAGE.md)
The bot includes a user-friendly CLI. Quick start:
# Initialize
npm run cli init
# Add wallets
npm run cli wallets add <address>
# Configure
npm run cli config --mode fixed --stake 25
# Start bot
npm run cli startSee CLI_USAGE.md for complete CLI documentation.
| Layer | Technology |
|---|---|
| Language | TypeScript 5.3+ |
| Runtime | Node.js 18+ |
| HTTP | axios |
| Data | Polymarket API |
| AI | OpenAI API |
| Interface | CLI |
src/main.ts- Main entry pointsrc/config.ts- Configuration managementsrc/api.ts- Polymarket API clientsrc/watcher.ts- Wallet monitoring with async generatorssrc/interpreter.ts- Trade normalizationsrc/sizing.ts- Position sizing logicsrc/executor.ts- Trade executionsrc/risk.ts- Risk managementsrc/strategy.ts- Trading strategies (Kelly criterion, expected value)src/agent.ts- AI event analysis with OpenAI
npx tsc --noEmit- QUICKSTART.md - Quick start guide
- README_TYPESCRIPT.md - Detailed TypeScript documentation
- MIGRATION_SUMMARY.md - Python to TypeScript migration details
For questions, support, or collaboration, reach out on Telegram: @terauss
MIT License.
Copy trades fast. Copy trades directly. No extra logic — just pure mirroring