Open-source TypeScript polymarket arbitrage trading bot that automatically mirrors top Polymarket traders in real time.
Follow profitable wallets across any market (crypto, elections, sports, macro, etc.) on polymarket.
Repository: github.com/JexTradesLab/Polymarket-Arbitrage-Trading-Bot.
This polymarket arbitrage trading bot connects to Polymarket’s APIs, monitors one or more target wallets (or a dynamic leaderboard), detects their trades, and replicates them in your wallet with customizable sizing, risk limits, and filters.
Live example polymarket arbitrage trading bot profile: PMTraderAdamBot
X profile: PMTraderAdam Telegram: PMAdamTrader
PMTraderAdam.Proof.mp4
Live results from the strategy this polymarket arbitrage trading bot automates — consistent execution across crypto up/down markets and event-driven positions.
Past performance does not guarantee future results. See Disclaimer.
git clone https://github.com/JexTradesLab/Polymarket-Arbitrage-Trading-Bot.git
cd Polymarket-Arbitrage-Trading-Bot
npm install# Windows
copy .env.example .env
# macOS / Linux
cp .env.example .env| Variable | Required | Description |
|---|---|---|
PM_PRIVATE_KEY |
Yes | 64-character hex private key (with or without 0x) |
PROXY_WALLET_ADDRESS |
No | Polymarket proxy/funder address for email or social-login accounts |
Wallet setup
| Account type | What to set |
|---|---|
| MetaMask / hardware wallet | PM_PRIVATE_KEY only — USDC in that EOA |
| Polymarket.com (email / Google) | Both PM_PRIVATE_KEY and PROXY_WALLET_ADDRESS (your profile address under Polymarket account settings) |
Never commit .env.
npm startOptional build:
npm run buildOn startup the bot connects to Polymarket feeds and begins monitoring configured markets. Press Ctrl+C to stop and see balance, P/L, and trade count.
- Node.js ≥ 20.6 (
package.json) - Polymarket wallet with USDC on Polygon
- Internet access (Polymarket Gamma + CLOB APIs)
Arbitrage and Copytrading
You can run either mode independently or both together.
- Monitor short-duration markets (primarily 5-minute and 15-minute Up/Down contracts on BTC, ETH, SOL, XRP, etc.) in real time via Polymarket’s Gamma API and CLOB WebSocket feeds.
- Detect high-probability entry windows — typically late in the market cycle when one side becomes a strong favorite (e.g., price enters the 0.97–0.99 band).
- Evaluate edge using price momentum, time remaining, and configurable thresholds.
- Execute directional bets (buy the heavy favorite) with precise timing to capture the small but consistent edge before resolution.
- Auto-exit / redeem at market close or when target profit is reached.
- Log & track every trade, P/L, win rate, and edge metrics.
The arbitrage mode runs continuously, scanning new markets as they open and focusing on the highest edge opportunities. It can operate on multiple assets and timeframes simultaneously.
- Ultra-fast monitoring of 5min / 15min Up/Down markets
- Configurable favorite price band sniping (e.g. 0.97–0.99)
- Momentum & time-based entry filters
- Support for BTC, ETH, SOL, XRP and more
- Automatic position sizing (fixed USD, % of balance, or Kelly-style)
- Risk controls (max exposure per market, daily loss limits, concurrent positions cap)
- Dry-run / simulation mode with historical replay
- Slippage and fee-aware order placement via CLOB
- Detailed logging + performance dashboard output
- Non-custodial — you control your private key
- TypeScript / Node.js for easy customization
| Setting | Description | Example Value |
|---|---|---|
| Markets | Assets to trade | btc, eth, sol, xrp |
| Timeframes | Market durations to monitor | 5min, 15min |
| Entry Price Min/Max | Favorite price band to enter | 0.97 / 0.99 |
| Entry Time Min/Max | Seconds remaining when entry is allowed | 250 / 290 |
| Bet Size | Amount per trade | $50 fixed or 5% of balance |
| Max Exposure | Total capital at risk across all open positions | 40% of balance |
| Max Concurrent Trades | Maximum simultaneous positions | 6 |
| Min Liquidity | Minimum market liquidity to consider | $10,000 |
| Daily Loss Limit | Stop trading if daily drawdown reached | -10% |
| Dry Run | Simulate without executing real trades | Enabled by default |
Tune everything in src/config.ts or via environment variables.
Screenshots:
(Your existing content remains unchanged — placed here for completeness)
- Monitor selected trader wallets (or auto top-performers) in real time.
- Detect new positions (buys/sells on specific markets/outcomes).
- Replicate the trade in your wallet with scaled size (fixed USD, percentage of balance, or ratio of the leader’s size).
- Apply rules — max allocation per trade, per trader, total exposure, blacklisted markets, minimum leader confidence, etc.
- Execute via Polymarket CLOB / CTF Exchange with slippage and fee handling.
- Log & track every copied trade, P/L, and performance vs. the leaders.
The polymarket arbitrage trading bot runs continuously and can handle multiple leaders simultaneously.
- Real-time trade copying from any Polymarket wallet
- Support for fixed USD, percentage-based, or ratio sizing
- Risk controls (max position size, daily loss limits, exposure caps)
- Leaderboard integration or manual wallet list
- Market filters (only copy certain categories, minimum liquidity, etc.)
- Simulation / dry-run mode
- Detailed logging to console +
logs.txt - Non-custodial — you control your private key
- TypeScript / Node.js for easy customization
| Setting | Description | Example Value |
|---|---|---|
| Target Wallets | Wallets to copy | Manual list or auto top-10 |
| Copy Ratio | Scale relative to leader’s trade size | 0.5x – 2x |
| Fixed Bet Size | Flat USD amount per copied trade | $25 – $250 |
| Max Exposure | Total capital at risk across all positions | 30% of balance |
| Min Leader Confidence | Only copy when leader buys above certain price | Yes @ ≥ $0.70 |
| Blacklist | Markets or assets to ignore | Custom |
| Dry Run | Simulate without executing | Enabled by default for testing |
Tune everything in src/config.ts or via environment variables.
Screenshots:
| Message | Meaning |
|---|---|
New 5m window (BTC, ETH, SOL, XRP) |
New 5-minute round for all assets |
BTC Up=0.98 Down=0.02 | ETH … |
Heartbeat — prices across markets |
Late entry window in 120s |
Waiting until t=250s |
Watching for late favorite @0.98–0.99... |
In entry window, price in band on at least one market |
[ENTRY] ETH BUY Up (favorite) @ 0.98 |
Late snipe on Ethereum 5m market |
[EXIT] BTC REDEEM Up @ 1.00 (resolution @ $1.00) |
Win — settled at $1/share |
[EXIT] SOL SELL … (favorite lost — exit at bid) |
Loss on Solana market |
Wallet balance is $0 |
Deposit USDC or fix PROXY_WALLET_ADDRESS |
History is appended to logs.txt.
Simulated terminal runs (market conditions vary):
| Starting balance | Per-trade size | Profit (example) |
|---|---|---|
| $100 | $10 | ~$40 |
| $500 | $50 | ~$300 |
| $1,000 | $100 | ~$500 |
These differ from the live @PMTraderAdam results above — the repo simulates logic locally; your real P/L depends on balance, sizing, and how often each asset hits the 0.97–0.99 band.
Constants in src/index.ts:
| Constant | Default | Purpose |
|---|---|---|
MARKETS |
btc, eth, sol, xrp |
Assets to monitor |
BET_USD |
10 |
Dollars per trade (per asset) |
ENTRY_TIME_MIN / ENTRY_TIME_MAX |
250 / 290 |
Entry window (seconds) |
ENTRY_PRICE_MIN / ENTRY_PRICE_MAX |
0.97 / 0.99 |
Favorite price band |
RESOLVE_SEC |
298 |
Settlement time |
FEE_BPS |
100 |
1% fee |
Polymarket-Arbitrage-Bot-500usd-Daily-Copytrading/
├── src/index.ts # Bot logic and strategy constants
├── .env.example # Environment template
├── logs.txt # Runtime logs (created on start)
├── package.json
└── tsconfig.json
Trading prediction markets involves substantial risk of loss.
This software is provided as-is for educational and personal use only.
- Small edge, large tail risk — ~$0.02/share at $0.98 entry; one reversal can erase many wins.
- Not every window trades — many cycles never hit 0.97–0.99 in time.
- This repo simulates P/L — live trading requires CLOB order placement and real fills; past on-chain results (@PMTraderAdam) do not guarantee future performance.
- Not financial advice — use at your own risk. Always start with small amounts and paper trade when possible.
This project is open source and available under the ISC License.
.jpg)
.jpg)
.jpg)
.jpg)







