What Is Polymarket Arbitrage Trading Bot?
Polymarket Arbitrage Trading Bot is an open-source Polymarket trading bot built by mila89 in TypeScript for developers who want automated UP/DOWN execution on Polymarket. It is one of the best Crypto Trading Bots tools for TypeScript developers and quant traders because it resolves BTC/ETH/SOL/XRP markets across 5m–24h windows, streams CLOB prices every second, and executes live orders against proxy-wallet balances instead of simulating PnL.
The repo is built around the Polymarket CLOB stack, trade.toml validation, and a deterministic decision loop. If you want a terminal-driven bot that behaves like production infrastructure rather than a dashboard toy, this is the right shape.
Quick Overview
| Attribute | Details |
|---|---|
| Type | Crypto Trading Bots |
| Best For | TypeScript developers and quant traders automating Polymarket |
| Language/Stack | TypeScript, Node.js 20.6+, @polymarket/clob-client-v2, Polygon, TOML, Zod |
| License | N/A |
| GitHub Stars | N/A as of Feb 2026 |
| Pricing | Open-Source |
| Last Release | N/A |
Who Should Use Polymarket Arbitrage Trading Bot?
- TypeScript engineers who want a code-first Polymarket automation layer with typed config, explicit strategy selection, and no browser automation.
- Quant traders running rule-based entry and exit logic on short-duration prediction markets where every second of spread movement matters.
- Indie hackers building a bespoke market-making or directional bot on top of the Polymarket CLOB without writing the wallet, balance, and retry plumbing from scratch.
- Operators with Polygon-funded proxy wallets who need a bot that reads actual on-chain state before deciding whether to buy, sell, or flip exposure.
Not ideal for:
- Purely discretionary traders who want manual charting, watchlists, and one-click UI order entry instead of a headless worker.
- Teams that cannot manage private keys or Safe-style proxy wallets because Polymarket Arbitrage Trading Bot depends on signer credentials and funded collateral on Polygon.
- Users expecting a no-config SaaS since this repo needs
trade.toml, environment variables, and local Node execution.
Key Features of Polymarket Arbitrage Trading Bot
- Live market slug resolution — the bot resolves the active market slug for the configured coin and time bucket, then pins the associated UP and DOWN
clobTokenIdsuntil the window expires. That prevents the strategy from drifting across market instances when the clock rolls forward. - One-second CLOB polling — it reads bid and ask data from
https://clob.polymarket.com/pricesevery second, which is the minimum cadence you want when spread movement and imbalance can invalidate an entry inside the same minute. This is a polling loop, not a cached dashboard feed. - On-chain balance awareness — order decisions use
getBalanceAllowanceto readCONDITIONALandCOLLATERALbalances on Polygon chain id 137. That means the bot reacts to actual wallet state, not an in-memory approximation of portfolio value. - Dual strategy engine —
trade_1is an exit-only model driven byremaining_time_ratioandup_price_ratio, whiletrade_2supports entry, exit, and an optional emergency swap. The code path is explicit, so you can audit the branch conditions instead of reverse-engineering a black box. - FAK order execution — it submits Fill-and-Kill market orders, retries transient failures, and polls after order submission to confirm settlement. That fits a trading loop where stale partial fills are worse than no fill.
- Typed configuration validation —
trade.tomlis Zod-validated at startup, which catches malformed strategy keys before the bot touches the market. For a bot like this, config validation is part of the safety model, not a nice-to-have. - Operator-friendly telemetry — the runtime prints market snapshots, position state, trend direction, spread, and engine status every few seconds. If you pair this with OpenTrace, you can keep execution logs and trade decisions inspectable instead of scraping stdout after the fact.
Polymarket Arbitrage Trading Bot vs Alternatives
| Tool | Best For | Key Differentiator | Pricing |
|---|---|---|---|
| Polymarket Arbitrage Trading Bot | Automated Polymarket execution in TypeScript | Deterministic strategy loop with live CLOB polling and on-chain balance checks | Open-Source |
| Polymarket web UI | Manual discretionary trading | Visual interface with no local code or private-key automation | Free |
| Kalshi | Regulated event-market trading | Different venue structure and compliance profile | Free to use with trading costs |
| Manifold Markets | Casual prediction-market experimentation | Simpler social betting experience, not a production bot runtime | Free |
Pick the Polymarket web UI if you want to eyeball a market and click orders manually. Pick Kalshi if your main constraint is venue selection and regulated market access, not programmable execution.
Pick Manifold Markets if you care more about public forecasting workflows than CLOB automation. If you need the execution layer to fit into a broader deployment pipeline, djevops is a better companion for release and environment automation than trying to hide deployment logic inside the trading loop.
If you are building a surrounding research workflow, OpenSwarm can help orchestrate multi-step market analysis, but it does not replace this bot’s order execution path. For observability, OpenTrace is the more relevant internal link because this repo emits frequent state transitions, retries, and position updates.
How Polymarket Arbitrage Trading Bot Works
Polymarket Arbitrage Trading Bot is built as a single-purpose worker: boot config, resolve the market, poll the CLOB, evaluate strategy rules, and submit orders. The design avoids browser scraping and instead uses the Polymarket client and API surface directly, which is the correct choice when you want the bot to survive market clock changes and repeatable restarts.
The data model is intentionally narrow. The runtime derives remaining_time_ratio from market time and up_price_ratio from the distance of UP price from $0.50, then feeds those signals into either trade_1 or trade_2. That keeps strategy logic tied to observable market state rather than indicator soup, and it makes the bot easier to audit when something trades unexpectedly.
npm install
npm run dev
Running the bot starts the TypeScript entrypoint, loads .env and trade.toml, bootstraps the Polymarket CLOB client, and begins the tick loop. Once live, it keeps checking market state, balances, and strategy thresholds until the market window expires or your config tells it to exit.
The implementation also separates concerns well. src/services/ handles external APIs, src/trade/ handles the strategy and order lifecycle, and src/config/ handles validation and slug resolution, so you can replace one piece without rewriting the whole stack. That separation matters if you later add a second strategy, custom risk controls, or trade logging to a warehouse via OpenTrace or a deployment wrapper with djevops.
Pros and Cons of Polymarket Arbitrage Trading Bot
Pros:
- Deterministic strategy selection —
trade_1andtrade_2are explicit and easy to reason about, which reduces hidden behavior in live trading. - Actual on-chain balance checks — the bot reads wallet state before acting, so execution reflects funded collateral and not stale assumptions.
- Fast market polling — one-second price refreshes are appropriate for short-window prediction markets where the spread can move quickly.
- Config validation at startup — malformed TOML is rejected early, which prevents half-configured bots from entering a live market.
- Retry and settlement checks — transient CLOB failures are handled with retries and post-order polling, which is better than assuming success after the first submit.
- TypeScript codebase — the project stays readable for teams that want static types, explicit interfaces, and familiar Node tooling.
Cons:
- No built-in backtesting — the repo is focused on live execution, so historical simulation and parameter sweeps are on you.
- Requires private-key and proxy-wallet management — operational overhead is unavoidable because the bot is meant to trade real funds.
- Strategy surface is limited — only
trade_1andtrade_2are implemented in the current engine, so complex signal stacks need custom development. - Market support is constrained — the 5-minute bucket is currently wired for BTC only, while ETH, SOL, and XRP are limited to longer windows.
- No hosted UI — if you want dashboards, alerts, or a control plane, you need to build them or bolt them on separately.
Getting Started with Polymarket Arbitrage Trading Bot
The quickest path is local Node execution with a funded Polygon proxy wallet and a valid signer key. You install dependencies, create .env, fill in trade.toml, and run the dev entrypoint.
npm install
cp .env.example .env
npm run dev
After startup, the bot prints the signer public key, active strategy, selected market, and trade_usd, then begins logging market and portfolio snapshots. The first thing to verify is that your proxy wallet holds USDC on Polygon and that your market coin and period match the supported slug rules in trade.toml.
If the bot refuses to enter a market, check the config validation output first. Most failures here come from invalid TOML keys, missing environment variables, or choosing a market bucket that is not wired for the selected coin.
Verdict
Polymarket Arbitrage Trading Bot is the strongest option for rule-based Polymarket automation when you want TypeScript code, live CLOB polling, and on-chain balance checks in one repo. Its main strength is deterministic execution; its main caveat is the need for real wallet ops and manual config. If you can manage that, it is worth running.



