PASS WITH FIXESTested on Composer 2.5, , result: PASS WITH FIXES.We built this monitor from the prompt and ran it on live public data from both venues with a test pair and placeholder fees, so it checks the math, not a real opportunity. It never places orders: no keys, orders or money. The prompt below includes the fixes from that run.
Short answer:A Polymarket–Kalshi arbitrage only exists if YES on one venue plus NO on the other costs less than $1.00 after fees, and both contracts settle on exactly the same outcome. Both conditions are rarer than bot sellers claim. This recipe builds an alerts-only monitor for market pairs you map by hand. It never places orders.
The idea: if YES on venue A plus NO on venue B costs less than $1.00 after fees, and both contracts settle on the exact same outcome, the pair locks in a gain. Both conditions are harder than they look.
Contract rules differ. Two markets with similar titles can have different resolution sources, deadlines and edge cases. Read rules_primary on Kalshi and the market description on Polymarket US for every pair.
Kalshi public data: GET /markets/{ticker} gives yes_ask_dollars / no_ask_dollars, and the order book (/markets/{ticker}/orderbook) is bids only.
Polymarket US public data: GET https://gateway.polymarket.us/v1/markets/{slug}/book and /bbo. price.value is always the YES side.
Kalshi's Developer Agreement: data only for your own trading. Keep alerts private. No public arb dashboards or paid alert channels.
DifficultyIntermediate
Time2–3 hours
Cost$0
Works withClaude Code, Cursor, ChatGPT / Codex, Grok
What will you build?
A local script that watches market pairs you map by hand (one Kalshi ticker ↔ one Polymarket US slug), computes the combined cost of opposite sides after fees, and alerts you when it's under $1.00 by your margin. It never places orders.
Who is it for?
Curious traders who keep seeing "risk-free arbitrage bot" videos and want to measure how often real, tradable gaps actually show up.
Not for:Anyone expecting free money. Most apparent gaps disappear once you count fees, depth, timing and differences in contract rules.
What prompt do you paste into your AI coding tool?
Works in Claude Code, Cursor, Codex/ChatGPT, Grok or any agent that can write files. Paste it into an empty folder. Read what it builds before you run anything.
Build a personal, ALERTS-ONLY cross-venue price monitor in Python.
It must never place, preview or cancel orders. No API keys are needed.
Use only documented public endpoints:
- Kalshi: https://external-api.kalshi.com/trade-api/v2
GET /markets/{ticker} (fields: yes_ask_dollars, no_ask_dollars,
yes_bid_dollars, no_bid_dollars, rules_primary, close_time, status)
GET /markets/{ticker}/orderbook (bids only: orderbook_fp.yes_dollars /
no_dollars)
- Polymarket US: https://gateway.polymarket.us
GET /v1/market/slug/{slug}, GET /v1/markets/{slug}/bbo,
GET /v1/markets/{slug}/book
(price.value is always the YES/long side)
pairs.yaml (I fill it in by hand; do NOT auto-match markets):
- name: "..."
kalshi_ticker: "..."
polymarket_slug: "..."
same_outcome: "yes_yes" # or "yes_no" if the YES sides are opposite
notes: "why I believe these settle identically"
rules_checked_on: "YYYY-MM-DD"
monitor.py:
- Every N seconds (config, default 30), for each pair compute the cost to
buy one unit of each opposite leg at the current best ASK on each venue,
using depth from the books (how many contracts are available at that price).
- Skip a pair (log why, never alert) if either leg has no ask, zero depth,
or the market isn't open (Kalshi status not active; Polymarket US
marketData.state not MARKET_STATE_OPEN). A null ask is "no price", never 0.
- Subtract estimated fees from fees.yaml. Ship a starter fees.yaml with
placeholder values and `placeholder: true`; while that flag is set, print
a loud warning on every run that the edges are not real. I replace the
numbers from each venue's official fee page.
- Alert when (1.00 - total_cost - fees) >= my margin AND depth >= my
min_size. Alert = print + append to logs/alerts.jsonl + optional desktop
notification. Optional: a Telegram message to MY OWN chat (token/chat id
from env vars).
- Skip pairs whose rules_checked_on is older than 14 days and say why.
- Rate-limit politely (stay far below each venue's limits), back off on 429.
- Never share or publish the data. Add a README note that this is for my
own trading only.
- tests: cost math including the Polymarket "price is always YES" rule.
Show the plan, build, then tell me how to run it.
How do you build it, step by step?
Find candidate pairs by hand. Search each venue for the same event: Kalshi GET /events or GET /markets?status=open&mve_filter=exclude, Polymarket US GET /v1/search?query=....
Read both rulebooks. Compare resolution source, cutoff time, and what happens on ties, delays or cancellations. If anything differs, it isn't a pair. Write your reasoning in notes.
Paste the prompt and fill in pairs.yaml and fees.yaml. Use only open markets that show a live bid and ask on both venues; an expired Polymarket US market returns a null best bid/ask. Until you replace the placeholder fees, every edge the monitor prints is fiction. Get fee numbers from each venue's official fee page, not from memory or a blog.
Run it for a week with python monitor.py and keep logs/alerts.jsonl.
Review honestly. How many alerts? How big? How deep? How long did each last? That data is the real answer to "do arbitrage bots work?"
If you ever act on an alert, do it by hand, with the Safety Pack limits in mind, on venues you're eligible to use.
How do you test it in paper or demo mode first?
This recipe is alerts-only, so it's paper by design. To make the alerts more realistic, add a simulated execution column: assume you hit each leg one after the other, 2–5 seconds apart, and re-price the second leg from the next snapshot. Many "gaps" vanish in that delay.
Track for each alert: size available, gap after fees, seconds until the gap closed, and whether the rules really matched. That's your evidence for or against building anything automated.
What safety checks does it need before real money?
Tick every box before the bot touches real money. The full rules file, .gitignore and pre-commit hook are in the Safety Pack.
Key handling: API keys and private-key files live in environment variables or a secrets manager. Never in code, prompts, chat logs, screenshots or git. .env and *.pem are in .gitignore, and your AI tool is blocked from reading them (see the Safety Pack).
Position limits: hard caps in config (max contracts per order, max total exposure, max daily loss). The bot refuses any order above them, and the caps are checked in code, not just in the prompt.
Kill switch: one command or one file (touch KILL) stops new orders immediately, and a second command cancels every resting order through the venue's cancel-all endpoint.
Paper first: paper or demo mode is the default. Live trading needs an explicit --live flag and a typed confirmation, and you only flip it after days of clean paper logs.
No order code at all. Grep for /orders and /order/; there should be zero hits.
Pairs are mapped by you, with the rules read and dated. Never auto-match by title.
Keep alerts private. Kalshi's Developer Agreement bars sharing API data with third parties without written permission.
Don't use international Polymarket from the US to "complete" a pair. It's close-only for US users.
Endpoints and rules were checked against these pages on Oct 19, 2026. APIs change, so if something here disagrees with the official docs, trust the docs and tell us.
Frequently asked questions
Do Polymarket–Kalshi arbitrage bots actually work?
Sometimes prices for similar events differ, but real, tradable arbitrage is rarer than videos suggest. Fees, thin depth, the delay between legs, and small differences in how each contract resolves wipe out most apparent gaps. Measure it with an alerts-only monitor before believing it.
Is arbitrage between Kalshi and Polymarket legal?
Trading the same event on two venues you're eligible to use isn't inherently prohibited, but you must follow each venue's rules and your local laws. US users should only use Kalshi and Polymarket US. This isn't legal advice.
Why does my arbitrage math look risk-free when it isn't?
The usual causes are ignoring fees, assuming fills at the best price for more size than exists, assuming both legs fill at the same instant, and treating markets with different resolution rules as identical.
Can I share arbitrage alerts in a Discord or sell them?
Not with Kalshi data. Kalshi's Developer Agreement limits API data to your own trading and bars sharing it with third parties without written authorization.
The Daily Bot Recipe
One new build recipe, one safety tip, and API changes worth knowing about. Free. No picks, ever.
A copy-paste AI prompt and step-by-step guide to the Polymarket US API: public market data with no key, then authenticated reads. Includes the international Gamma API, read-only, with a geoblock check.
Step-by-step: use Claude Code to build a Polymarket US trading bot that runs in paper mode by default, with a local paper ledger, order preview, hard position limits and a kill switch.
Get started with the Kalshi API using an AI coding tool: public market data with no key, then RSA-PSS or Ed25519 signed requests against the Kalshi demo environment. Endpoints checked against the official docs.