A TypeScript-based CLI bot for automatically copying trades from selected traders on Polymarket.
Telegram: @brunomadrigal49
GitHub: https://github.com/brunomadrigal0/polymarket-trading-bot
- 🤖 CLI Interface - Easy-to-use command-line interface
- 📊 Copy Trading - Automatically copy trades from selected traders
- 📝 Console Logging - All trade activities logged to console
- ⚙️ Configurable - Set min/max trade amounts, slippage tolerance, and more
- 📈 Real-time Monitoring - Monitor multiple traders simultaneously
- Clone the repository:
git clone https://github.com/brunomadrigal0/polymarket-trading-bot.git
cd polymarket-trading-bot- Install dependencies:
npm install- Build the project:
npm run build- Copy the example environment file:
cp env.example .env- Edit
.envwith your configuration:
# Polymarket Configuration
POLYMARKET_API_URL=https://clob.polymarket.com
# Wallet Private Key (for executing trades)
PRIVATE_KEY=your_private_key_here
# Copy Trading Settings
COPY_ENABLED=true
MIN_TRADE_AMOUNT=0.01
MAX_TRADE_AMOUNT=100
SLIPPAGE_TOLERANCE=0.01
# Traders to Copy (JSON array)
TRADERS=[{"address":"0x123...","name":"Trader1","minTradeAmount":0.1,"maxTradeAmount":10}]
⚠️ Important: the bot will not start unless at least one trader is configured. If you see the errorError initializing bot: At least one trader must be configuredeither set a valid JSON array in
TRADERSor run the interactive setup withnpm run cli setup.
npm run cli startnpm run cli start -- --daemonnpm run cli statusnpm run cli tradesnpm run cli marketsnpm run cli confignpm run cli setupnpm run cli stopWhen you start the bot without --daemon flag, you'll see an interactive menu:
╔═══════════════════════════════════════════════════════════╗
║ Interactive Menu ║
╠═══════════════════════════════════════════════════════════╣
║ 1. Check Status ║
║ 2. View Recent Trades ║
║ 3. View Markets ║
║ 4. View Configuration ║
║ 5. Stop Bot ║
║ 0. Exit ║
╚═══════════════════════════════════════════════════════════╝
npm run devnpm run watchpolymarket-copy-trading-bot/
├── src/
│ ├── cli.ts # CLI interface
│ ├── index.ts # Main bot class
│ ├── config/ # Configuration management
│ ├── services/ # Service classes
│ │ ├── polymarket.ts # Polymarket API client
│ │ └── tradeExecutor.ts # Trade execution logic
│ └── types/ # TypeScript type definitions
├── dist/ # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md
- Monitoring: The bot continuously monitors trades from configured trader addresses
- Filtering: Trades are filtered based on your configuration (min/max amounts, markets, etc.)
- Execution: Approved trades are automatically executed on your behalf
- Logging: All trade activities are logged to the console with detailed information
For issues and questions, contact @brunomadrigal49 on Telegram.