Yes, you can run a Kalshi trading bot: Kalshi documents its API for real-time market data and trade execution, and its rulebook covers orders placed by automated functionality. Kalshi 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.
Does Kalshi allow bots?
Yes, Kalshi allows bots. Its developer docs describe the API as covering real-time market data and trade execution, and its rulebook treats orders sent by automated functionality like any other order. A bot also takes on the rules a person would follow. Using the API binds you to Kalshi's Developer Agreement, the rulebook requires controls against excessive messaging, and the member is responsible for every order the bot sends.
Scroll horizontally to compare →
| Source | What it says | What it means for your bot |
|---|---|---|
| Kalshi API docs | The API covers the Kalshi Exchange for real-time market data and trade execution. Using it binds you to Kalshi's Developer Agreement. | API trading is a supported use. Read the Developer Agreement before your first order. |
| Order quick start | Lists "Build automated trading strategies" as a next step and recommends a client_order_id on every order for deduplication. | Kalshi expects programs to place orders and gives you a tool to make retries safe. |
| Rulebook v1.31, Rule 5.4 | Members sending orders or cancellations "whether manually or via automated functionality" must have controls against excessive messaging. The member is responsible for orders confirmed for its account. | Rate-limit your own bot, cap order counts, and treat every accepted order as yours. |
Sources: Kalshi API docs · Kalshi order quick start · KalshiEX Rulebook v1.31
Kalshi pages read 2026-11-11. Rulebook text quoted from version 1.31. This is a summary for builders, not legal advice; the rulebook and your agreements with Kalshi govern.
Alerts or a trading bot?
Many searches for a Kalshi bot are really asking for alerts. The difference is who presses the button. An alert bot tells a person that something happened. A signal bot writes down the trade it would make and lets you review it. An auto-trading bot signs and sends orders itself. Each step adds code you have to trust with money, so start with the least automation that does the job.
Scroll horizontally to compare →
| Setup | How it works | What you need |
|---|---|---|
| Alert bot | A post from a tracked account reaches a Discord channel or your app. A person reads it, opens Kalshi and decides. | TweetStream with Discord delivery or a WebSocket client. No Kalshi API key. |
| Signal bot | Your code matches the post to a market, reads the order book and writes a paper intent with side, size and evidence. Nothing trades. | TweetStream WebSocket, read-only Kalshi market data, a store for intents. |
| Auto-trading bot | The same pipeline signs and submits orders through Kalshi's API inside hard risk limits and a kill switch. | Everything above, plus a Kalshi API key, a risk engine, client_order_id handling and reconciliation. |
Join the catalyst to the contract
A Kalshi trading bot that reacts to posts needs two separate inputs: Kalshi's official interface for market state and execution, and a fast event feed for the public posts that can change a contract's probability. TweetStream supplies selected X posts, plus supported Truth Social posts on Pro and above. Your strategy decides whether the evidence is relevant and safe to trade.
Scroll horizontally to compare →
| Layer | Interface | Job |
|---|---|---|
| Social event | TweetStream WebSocket | Selected posts, account events, OCR and trading context |
| Market state | Official Kalshi API | Events, contracts, order books, positions and exchange status |
| Strategy | Your service | Source mapping, direction, confidence, freshness and risk |
| Execution | Official Kalshi API | Validated orders, acknowledgement, fills and reconciliation |
Sources: Kalshi developer documentation · Kalshi WebSocket documentation · TweetStream WebSocket quickstart
Public interfaces reviewed 2026-11-11. Kalshi's API covers market data and trade execution over REST, WebSocket and FIX. It has no news or social feed. TweetStream does not supply Kalshi market data or place Kalshi orders.
Kalshi 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, kill switch)
-> Kalshi REST or WebSocket (order, acknowledgement, fill)Kalshi markets that move on posts
Some Kalshi contracts settle on social posts directly. Kalshi's filings with the CFTC define a weekly contract on how many times an account posts on X, a contract on whether a specific post is deleted, and one on an account's follower count. Many more markets react to posts without settling on them: an agency announcing a rule, an official confirming a nominee, a company posting a launch date. For both kinds, a stream of the accounts that matter gives your bot the evidence as it appears.
Scroll horizontally to compare →
| Contract | What it settles on | Where a real-time stream fits |
|---|---|---|
| TWEETS | Posts on X by a named account in a period. Main feed posts, quote posts and reposts count. Kalshi counts through the X API, which it calls every five minutes; a deleted post counts if it stayed up long enough to be picked up. | Each post reaches your running count as it lands, between Kalshi's five-minute checks. A post you saw that was deleted within minutes may never enter Kalshi's count, so track deleted posts separately. |
| DELETEPOST | Whether a named post on a named platform is still available through the platform's standard public interface before a date. Sources include the platform, listed news outlets and the account holder's statements. | tweet/delete events, sent when observed for accounts you track, are a lead to verify. Settlement follows the public interface and the listed sources. |
| FOLLOWERCOUNT | An account's publicly displayed follower count on a platform, with the platform first and Social Blade second as sources. | A post stream does not carry follower counts. Read the public profile; posts can only tell you why the count might move. |
Sources: Kalshi TWEETS filing · Kalshi DELETEPOST filing · Kalshi FOLLOWERCOUNT filing
Contract terms from Kalshi's CFTC filings (TWEETS February 13, 2025; FOLLOWERCOUNT August 22, 2025; DELETEPOST August 26, 2025), read 2026-11-11. Kalshi settles these contracts. TweetStream does not resolve them or reproduce Kalshi's count.
Build the watchlist from the contract rules
Read the contract rules before building the watchlist. A government release may depend on an agency or official; an economic contract may depend on a scheduled report; a company event may depend on a corporate account or executive. A post-count contract names its account, so that account is the whole watchlist. The tighter the source map, the less noise your bot has to classify under time pressure.
- Store the Kalshi event ticker, market ticker, rules, sources, evidence terms and expiry together
- Give official and first-party accounts the highest source confidence
- Add supported Truth Social posts for political contracts; they come with Pro and above
- Disable mappings as soon as the contract closes or the trading thesis expires
Kalshi API essentials for bots
Four parts of Kalshi's API shape how a bot is built: how requests are signed, how fast you may send them, where you can test without money, and how to retry an order without doubling it. The table summarizes Kalshi's documentation; follow the links for the full reference before writing the client.
Scroll horizontally to compare →
| Topic | What Kalshi documents | What to build |
|---|---|---|
| Keys and signed requests | Each request carries KALSHI-ACCESS-KEY, KALSHI-ACCESS-TIMESTAMP (milliseconds) and KALSHI-ACCESS-SIGNATURE, a signature over the timestamp, HTTP method and path without the query string. Ed25519 is the recommended default key type; RSA-PSS is the alternative. Kalshi does not store your private key. | Keep the private key in a secret store the strategy process cannot read directly, and sign in one small module. |
| Rate limits | Token buckets per tier, with separate read and write budgets. Basic allows 200 read and 100 write tokens per second; most requests cost 10 tokens. Advanced comes from an upgrade endpoint, Expert to Prestige from 30-day trading-volume share. Over the limit you get HTTP 429 with no Retry-After header. | Budget tokens per second in your own client, back off exponentially on 429, and remember batches are billed per item. |
| Demo environment | A separate environment with mock funds at https://external-api.demo.kalshi.co/trade-api/v2 and wss://external-api-ws.demo.kalshi.co/trade-api/ws/v2. Credentials are not shared with production. Demo prices and behavior may not reflect real markets. | Point the whole bot at demo first to test signing, orders, cancels and reconnects. Judge edge on production data only. |
| Idempotent orders | client_order_id is optional but recommended. Resubmitting with the same ID is rejected as a duplicate (409 Conflict), which prevents accidental double orders. | Derive the ID from your intent, store it before submitting, and retry with the same ID after a timeout. |
Sources: Kalshi API keys · Kalshi rate limits · Kalshi demo environment · Kalshi order quick start
Kalshi documentation read 2026-11-11. Figures are for Kalshi's event-contract API; its perpetual futures API has a separate rate-limit table.
Turn one social event into one inspectable intent
Route each TweetStream content event by platform and author, attach later OCR or other enrichment to the same candidate, and read current Kalshi market state before producing a paper intent. The maintained local example covers Kalshi and Polymarket mappings, duplicate rejection, stale-event checks, liquidity limits and position limits without placing an order.
- Persist a stable event identity before any side effect
- Reject events outside the strategy's freshness window
- Read current market state instead of trusting a cached probability
- Score image OCR and detected trading context as evidence; neither should place an order on its own
Example: from one post to one decision
Take a contract that resolves on whether an agency announces a rule by a set date, with the agency's X account on your watchlist. When that account posts, your bot receives a tweet/content event and works through these steps before any order exists:
- Match the author and text to the stored mapping for that market ticker, and drop the event if it is outside the freshness window
- Read the current Kalshi order book and skip the trade if spread or depth breaks your limits
- Write a paper intent with the event ID, market ticker, side, size cap and the post text as evidence
- If a later
tweet/metaevent adds OCR text, attach it to the same candidate and score it again before the intent goes to review
Example: tracking a post-count contract
Now take a TWEETS market on how often an account posts this week. Your bot keeps its own count and compares it with the strike prices on the board. Your count can differ from Kalshi's, because Kalshi settles from its own five-minute checks of the X API, so build in a margin for posts that both sides might count differently.
- On each
tweet/contentevent from the named account, add one if the post is a main feed post, quote or repost; Kalshi's terms do not count replies - On a
tweet/deleteevent, keep the post in the count but flag it, since Kalshi counts deleted posts that lasted long enough to be picked up - After each change, recompute the implied distribution for the rest of the period and compare it with the current order book
- Before the period closes, reconcile your count against the account's public timeline and widen your margin if they disagree
Bot types and where social signals fit
Kalshi bots fall into four broad types. Signal or news bots trade on outside evidence such as posts, data releases or scores; this is the only type TweetStream feeds. Market-making bots quote both sides and earn the spread. Arbitrage bots trade price gaps between related contracts or venues. AI-assisted bots use a model to estimate probabilities and need the same hard limits as any other. Whichever you build, Kalshi's rulebook provides for trading fees, with amounts posted on its website, so put fees into every edge calculation. You can build from scratch, start from an open-source project, or pay for a hosted tool:
Scroll horizontally to compare →
| Option | What it is | Fit |
|---|---|---|
| Build your own | Your code on Kalshi's official API, with your own data inputs such as a TweetStream WebSocket | Full control over signals, risk and latency; you maintain everything |
| OctagonAI kalshi-trading-bot-cli | MIT-licensed TypeScript CLI that researches markets, estimates probabilities, computes edge against live order books and places trades with Kelly sizing and a risk engine | A starting point for model-driven trading you can read and modify |
| ryanfrigo kalshi-ai-trading-bot | MIT-licensed Python toolkit (CLI, MCP server, Claude skill) built to measure whether a strategy beats the book | Evaluating an edge before committing capital |
| Bot for Kalshi | Hosted no-code tool: rules in plain language, a Paper mode with no API key, then limit orders through Kalshi's API on your key. $99 a month; Kalshi fees are separate | Rule-based bots without writing code |
Sources: OctagonAI kalshi-trading-bot-cli · ryanfrigo kalshi-ai-trading-bot · Bot for Kalshi · KalshiEX Rulebook v1.31 (fees: Rule 3.13)
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.
Let an AI coding agent accelerate the build
Use Claude Code, Codex, Cursor or another AI coding agent to scaffold adapters and tests, and keep production capital out of its reach. Give it the public TweetStream envelope contract, the Kalshi client boundary, deterministic fixtures and a paper-only output schema. 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. Keep secrets and irreversible actions outside its tool access.
Measure the path that can win or lose the trade
Record source publication, local TweetStream receipt, decision completion, Kalshi 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 signal-to-fill result also includes network transit to your host, strategy, risk and venue time.
Earn the right to place the first order
A production bot should fail closed on ambiguity. Run the whole bot against Kalshi's demo environment first to prove signing, order placement, cancels and reconnects; Kalshi says demo prices and behavior may not match real markets, so do not read profit or loss from it. Then replay history, shadow the live feed and paper-trade on production data. Go live with hard exposure and daily-loss limits. No model score should bypass market-open checks, minimum liquidity, maximum spread, stale-event rejection, idempotent order handling or a kill switch controlled outside the strategy process.
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;
}