Yes, you can run a Polymarket bot. Polymarket's docs cover placing orders from code through its CLOB API, and its Builder Program supports apps that route orders. Polymarket has no news or social feed, so a bot that trades on posts needs a second input: TweetStream streams posts from the X accounts you choose, plus supported Truth Social posts on Pro and above. US residents trade on Polymarket US, which has its own API.
Does Polymarket allow bots?
Yes. Polymarket documents programmatic trading from start to finish: you authenticate with the CLOB API, sign orders with your wallet and send them over REST, and its Builder Program is built for apps that route orders for other people. Your residence, citizenship and location decide whether you may trade there, wherever the bot is hosted. Polymarket rejects new orders from some countries, including the United States, and its Terms bar anyone who resides in, is a citizen of, or is located in a restricted place. Using a VPN to get around this is prohibited. US residents trade on Polymarket US, a separate CFTC-regulated exchange with its own API.
Scroll horizontally to compare →
| Source | What it says | What it means for your bot |
|---|---|---|
| Polymarket API docs | Public market data needs no credentials. Private CLOB requests use two layers: a wallet signature creates API credentials, then each request is signed with them. Orders also carry a wallet signature. | API trading is a supported use. Keep the wallet key and the API secret away from strategy code. |
| Builder Program tiers | Builders create API keys in their Polymarket settings and attach a builder code to orders for attribution. Unverified builders get 100 relayer transactions a day and Verified builders 10,000. | Polymarket expects third-party apps to place orders and attributes them to the builder. |
| Geographic restrictions | Orders from blocked regions are rejected. The United States, the United Kingdom, France and others are close-only on both the website and the API. Polymarket's Terms bar anyone who resides in, is a citizen of, or is located in a restricted place, and prohibit using a VPN to get around the block. A geoblock endpoint reports whether the caller's IP is blocked. | Check that the account holder is eligible, wherever the bot runs. The geoblock endpoint covers only the server's IP. Plan for accounts that can only close positions. |
| Polymarket US | A fiat exchange regulated by the CFTC as a designated contract market. Its Retail API needs identity verification and an API key from the developer portal. | A bot run by a US resident uses Polymarket US and its API, not the international CLOB. |
Sources: Polymarket API docs · Polymarket Builder Program tiers · Polymarket geographic restrictions · Polymarket Terms of Use · What is Polymarket US? · Polymarket US API authentication
Polymarket pages read 2026-11-11. This is a summary for builders, not legal advice; Polymarket's terms and the rules of the venue you trade on govern.
Polymarket bot types and where news fits
Polymarket bots come in five common types, and each reacts to a different input. Only the news or signal type needs posts from outside Polymarket, and that input is the part TweetStream supplies. Whichever type you build, Polymarket charges takers a fee in most market categories, so put the fee into every edge calculation.
Scroll horizontally to compare →
| Bot type | What it reacts to | Data it needs |
|---|---|---|
| Copy trading | Trades by the wallets you follow | Wallet activity from Polymarket's Data API, plus your own sizing and caps |
| Arbitrage | Price gaps between related outcomes, markets or venues | Live order books from the CLOB market channel and any venue you compare |
| Market making | Its own quotes, the spread and its inventory | Order books, fills and Polymarket's maker rebate schedule |
| News or signal | Posts, announcements and data releases that change a market's odds | A real-time post feed such as TweetStream, plus Polymarket market data |
| Alert bot | Any of the above, sent to a person instead of becoming an order | The same inputs, plus a channel such as Discord |
Sources: Polymarket real-time data · Polymarket fees · Quicknode copy-trading bot guide
Polymarket docs and the linked guide read 2026-11-11.
Catch the catalyst before the odds finish moving
Odds move when new information reaches the market. TweetStream gets selected X posts, plus supported Truth Social posts on Pro and above, into your strategy. Polymarket's own APIs supply markets, prices, order books and execution. Keep those boundaries separate, then shorten the path from source post to risk-approved order.
- Polymarket APIs: Gamma for markets, the CLOB for prices, order books and orders, the Data API for positions and activity
- TweetStream: selected X posts and supported Truth Social posts over one WebSocket
- Strategy service: source mapping, classification, confidence and risk
- Execution service: order construction, limits, idempotency and reconciliation
Polymarket trading bot data flow from social post to order
textX or Truth Social post
-> TweetStream WebSocket (tweet/content, tweet/meta, tweet/delete)
-> your strategy service (source map, freshness, confidence)
-> risk checks (limits, spread, depth, taker fee, kill switch)
-> Polymarket CLOB (signed order, match, fill)Polymarket API essentials for bots
Five parts of Polymarket's API shape how a bot is built: which endpoint does what, how requests are signed, how fast you may send them, what each trade costs, and whether your location may trade at all. The table summarizes Polymarket's documentation; follow the links for the full reference before writing the client.
Scroll horizontally to compare →
| Topic | What Polymarket documents | What to build |
|---|---|---|
| Endpoints | Gamma API (https://gamma-api.polymarket.com) for events and markets; CLOB API (https://clob.polymarket.com) for prices, order books and orders; Data API for positions and activity; the CLOB market channel (wss://ws-subscriptions-clob.polymarket.com/ws/market) for live book and price updates. | Prototype on public market data with no keys. Add credentials only to the execution service. |
| Authentication | L1: the wallet signs an EIP-712 ClobAuth message to create or derive an API key, secret and passphrase. L2: each private request is signed with HMAC-SHA256 over the timestamp, method, path and body, and sent with five POLY_* headers. | Keep the wallet key and the API secret in one small signing module the strategy cannot read. |
| Rate limits | IP-based Cloudflare limits throttle requests instead of rejecting them; the CLOB's general limit is 9,000 requests per 10 seconds. Orders and cancels also draw from per-signer token buckets, which have run in warning mode since July 24, 2026: requests still go through, and a Poly-RateLimit-Warning: true header marks the ones enforcement would reject. Polymarket will announce when enforcement starts. The Standard tier refills 40 order tokens per second with a burst of 60, and a 429 response carries Retry-After. | Budget orders per second in your own client and wait as long as Retry-After says. |
| Fees | Only takers pay, at match time: fee = C × feeRate × p × (1 - p). Rates differ by category, for example 0.04 for politics, 0.07 for crypto and 0 for geopolitics. Makers pay no fee. | Price the fee into every signal. A politics trade at 50¢ pays 1¢ per share. |
| Location check | GET https://polymarket.com/api/geoblock reports whether the caller's IP is blocked from placing orders, with its country and region. It checks the server, and the Terms apply to the person or entity trading. | Run it at startup and alert when it changes, so a block shows up before orders start failing. A passing result does not make an ineligible account holder eligible. |
Sources: Polymarket API overview · Polymarket rate limits · Polymarket CLOB trading rate limits · Polymarket fees · Polymarket geoblock endpoint
Polymarket documentation read 2026-11-11. Figures are for the international Polymarket CLOB; Polymarket US documents its own API and limits.
Map every market to its decisive sources
Polymarket's docs say the market title describes the question and the rules define how it resolves, so build each source map from the rules. Every market names a resolution source, an end date and its edge cases, and prediction markets resolve through the UMA Optimistic Oracle after a two-hour challenge period. If a market resolves from an agency announcement, track the agency and the officials who speak for it. If it resolves from a company action, track the company, its executives and the reporters who cover it. For political markets, add supported Trump and White House Truth Social posts.
- Store the market ID, resolution rules, source handles, keywords and end date together
- Rank first-party sources above commentary accounts
- Check author identity and post time before interpreting the text
- Expire mappings as soon as the market closes or the thesis changes
Polymarket markets that settle on X posts
Polymarket lists markets on how many times an account posts on X, such as its weekly and monthly Elon Musk tweet-count markets. Their rules spell out what counts, and each rule lines up with a field a TweetStream event already carries. The resolution source is Polymarket's own post counter, so your running count is a forecast of that number.
Scroll horizontally to compare →
| Market rule | What it means for your count | TweetStream event |
|---|---|---|
| Main feed posts, quote posts and reposts count | Add one for each original post, quote and repost | tweet/content with kind set to post, quote or retweet |
| Replies do not count, except replies that show up on the main feed | Most replies are excluded, but the tracker counts the main-feed exception | kind is reply; keep these in a separate tally and check them against the tracker |
| Deleted posts count if they stayed up long enough for the tracker to capture them (about 5 minutes) | A post deleted within minutes may never enter the count | tweet/delete, sent when observed for accounts you track, lets you flag the post and how long it was up |
| The resolution source is the Post Counter at xtracker.polymarket.com, with X as the secondary source | Polymarket settles on its tracker, so your own count can differ | Reconcile your count against the tracker before the period ends |
Sources: Polymarket: Elon Musk # tweets August 28 - September 4, 2026 · Polymarket XTracker · Polymarket resolution
Rules quoted from the Polymarket market for August 28 to September 4, 2026, read 2026-11-11 through Polymarket's Gamma API. Each market has its own rules, so read them before trading. Polymarket resolves these markets; TweetStream does not resolve them or reproduce the tracker's count.
Turn the live feed into one inspectable decision path
Open one TweetStream WebSocket, route content events by author, and join matching posts to open Polymarket markets. Keep the first pass deterministic: the source matches, an evidence term is present, the market is open, the event is fresh and you have not processed it before. The maintained example runs this locally for both Polymarket and Kalshi and never places an order.
- Authenticate with the TweetStream v1 WebSocket subprotocol
- Persist event IDs before producing any trade side effect
- Use OCR text when the market-moving detail is published in an image
- Let enrichment events update a candidate without holding up the first content decision
Turn the post into a bounded decision
Classification should produce a small decision object: market ID, implied direction, confidence, evidence span, event timestamp and expiry. Risk rules can then check each field, and a language model never becomes the execution policy.
- Reject posts that do not map to explicit resolution rules
- Require stronger confidence as liquidity falls or the spread widens
- Set a maximum event age and a maximum odds move before entry
- Send ambiguous events to a person on the desk instead of forcing a trade
Example: from one post to one paper intent
Take a market on whether a central bank holds rates at its next meeting, with the bank's X account on your watchlist. When the account posts the decision, your bot receives a tweet/content event. If TweetStream detects a prediction market in the post, a follow-up tweet/meta event adds the market and its price. Before any order exists, the bot works through these steps:
- Match the author and text to the stored mapping for that market, and drop the event if it is outside the freshness window
- Treat a market detected in
tweet/metaas a hint, and confirm it is the market in your mapping before using it - Read the current order book from the CLOB and skip the trade if spread, depth or the taker fee leaves no edge
- Write a paper intent with the event ID, market, side, size cap and the post text as evidence, then send it to review
Build, open-source or hosted Polymarket bots
You can write the bot yourself, start from an open-source project, or pay for a hosted tool. The options below are news-focused, plus one copy-trading tutorial for comparison.
Scroll horizontally to compare →
| Option | What it is | Fit |
|---|---|---|
| Build your own | Your code on Polymarket's official SDKs or APIs, with your own inputs such as a TweetStream WebSocket | Full control over sources, risk and latency; you maintain everything |
| Polymarket/agents | Polymarket's MIT-licensed framework for AI agents that trade on Polymarket. The repository is archived and was last updated in November 2024 | Seeing how Polymarket laid out agent tools; check it against the current SDKs before reuse |
| brodyautomates/polymarket-pipeline | Public repository for an event-driven pipeline that monitors breaking news, classifies market impact with Claude and trades niche Polymarket markets. No license is listed | A news-trading design you can read |
| PolyOracle | Hosted news-trading tool that watches Twitter, Telegram and RSS, classifies stories with AI and starts in dry-run mode. It advertises under 5 seconds from ingestion to order placement | News trading without writing code |
| Quicknode copy-trading guide | TypeScript tutorial that polls Polymarket's Data API for a target wallet's trades and mirrors them inside size caps | Copy trading instead of news trading |
Sources: Polymarket/agents · brodyautomates/polymarket-pipeline · PolyOracle news trading · Quicknode copy-trading bot guide
Reviewed 2026-11-11 from each project's own page. Descriptions restate what the projects say about themselves; TweetStream has not tested them and makes no performance claims for any of them.
Use an AI coding agent without giving it the keys
Use a coding agent to build the adapter, and give any Polymarket agent framework narrow tools with no control over capital. The framework should read typed market data and produce paper-only intents. TweetStream's remote MCP server gives the agent tools to change the streamed accounts and fetch the sandbox connection, and the keyless sandbox streams a fixed list of 50 X accounts 60 seconds late, so the agent can run the pipeline end to end without a key. Deterministic code checks source identity, market state, freshness, liquidity, exposure and order idempotency before any execution client is called.
- Use Claude Code, Codex, Cursor or another coding agent to adapt the maintained fixture-backed example
- Expose narrow tools for market reads and paper intents, with no direct exchange access
- Require schema-validated decisions with evidence spans, confidence and expiry
- Keep API credentials, maximum loss and the kill switch outside the agent runtime
Measure the path from post to fill
Record the source post timestamp, TweetStream arrival, classifier completion, order submission, exchange acknowledgement and fill as separate timestamps. TweetStream detects X posts in typically 166 ms, measured from X's post timestamp to first receipt on a TweetStream server. Live figures are at tweetstream.io/speedcheck. That figure stops at the TweetStream server; your post-to-fill time also includes network transit to your host, your own processing and Polymarket's matching. Polymarket's primary servers are in eu-west-2. The closest region that is not geo-restricted is eu-west-1, and co-locating in eu-west-2 requires completing Polymarket's KYC/KYB form. Measure from where your execution service actually runs.
Prove the strategy before giving it capital
Polymarket's documentation index lists no demo exchange for the international CLOB (checked 2026-11-11), so testing happens on read-only production data. Replay captured events against historical market snapshots, then shadow the live feed without placing orders. Promote only strategies whose source mappings, stale-event rules and loss limits hold up in both, and start live trading at small size.
- Backtest market mapping and classifier direction separately
- Shadow live events and compare theoretical prices with the prices you could have filled at
- Start with hard position and daily-loss limits
- Keep a kill switch outside the classifier and the execution worker
Implementation asset: prediction-market source router
Turn validated X and supported Truth Social events into typed, venue-neutral routing decisions. Adapt the source list, market mapping, and keyword rules to your strategy, then keep duplicate, stale-event, position-limit, credential, and execution controls in deterministic code around this pattern.
type SocialPlatform = "twitter" | "truth_social" | "binance_square";
type TweetStreamContentEvent = {
d: {
author: { handle?: string; platform: SocialPlatform };
createdAt: number;
kind: "post" | "quote" | "reply" | "retweet";
text: string;
tweetId: string;
};
id?: string;
op: "content";
t: "tweet";
ts: number;
v: 1;
};
const sourceRules = [
{
handles: ["whitehouse", "potus"],
platform: "twitter",
strategy: "policy-markets",
terms: ["executive order", "tariff"],
venue: "polymarket",
},
{
handles: ["realdonaldtrump"],
platform: "truth_social",
strategy: "trade-policy",
terms: ["trade policy", "announcement"],
venue: "kalshi",
},
] as const;
export function routePredictionMarketSourceEvent(event: TweetStreamContentEvent) {
const handle = event.d.author.handle?.toLowerCase().replace(/^@/, "");
const platform = event.d.author.platform;
const text = event.d.text.toLowerCase();
const rule = sourceRules.find(
(candidate) =>
candidate.platform === platform &&
candidate.handles.some((candidateHandle) => candidateHandle === handle),
);
const matchedTerm = rule?.terms.find((term) => text.includes(term));
if (!rule || !matchedTerm) {
return { deliver: false } as const;
}
return {
deliver: true,
eventId: event.d.tweetId,
matchedTerm,
strategy: rule.strategy,
venue: rule.venue,
} as const;
}