Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk7 min

How to Build a Python Arbitrage Scanner for Polymarket and Kalshi—and What to Verify About Predicton

A practical architecture for scanning prediction markets: discover and match equivalent contracts, normalize executable depth, estimate net margins, and keep trading credentials and execution risk separate.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A useful prediction-market scanner does more than compare displayed prices: it checks that two contracts resolve the same way, estimates what can actually be bought at available depth, and subtracts fees and execution risk. Build it first as an alert-only system. Polymarket and Kalshi document API workflows that can inform separate adapters; the available information does not establish Predicton’s identity or API, so don’t implement a Predicton connector until you know exactly which service you mean.

What the scanner should decide

For each pair of markets, the scanner should answer a narrow question: can complementary outcomes be acquired on both venues at executable prices and sizes, with a positive margin after fees and other known costs, while leaving the two positions with equivalent settlement conditions?

As an Amazon Associate I earn from qualifying purchases.

That result is a candidate, not a guarantee. Quotes can become stale, a leg can fill without the other, and contracts with similar titles can resolve differently. Platform documentation explains how to access data and place or settle orders; it does not establish a profitable strategy or a universal arbitrage formula.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Identify each venue before writing an adapter

Venue What the official documentation establishes What you still need to verify
Polymarket Its trading quickstart includes Python using AsyncSecureClient: retrieve a market by slug, select an outcome trading identifier based on market version, submit a market buy, and wait for asynchronous settlement. Use current market-data documentation and SDK details to choose a read-only collection path. The trading quickstart is evidence of a workflow, not a recommendation for a high-frequency scanner.
Kalshi Its official Quick Start: Market Data describes unauthenticated public Trade API access to series, events, markets, and orderbooks; the Python example uses requests and notes that responses may be paginated with cursors. Its orderbook response provides bids, not asks. Normalize bid-only data into executable prices and sizes, and check current market rules, fees, and availability for your circumstances.
Predicton The available material does not establish which service this name refers to or provide an authoritative API or market-rules page. Confirm the exact service and find its official API, market rules, fee schedule, and access requirements before adding it. Do not infer endpoints or market coverage.

The platform documentation described here was accessed October 7, 2026. APIs, fees, rules, and availability can change; recheck the official documentation before relying on an implementation.

Build the scanner as independent stages

1. Discover markets and keep their provenance

Create a separate adapter for each confirmed venue. Each adapter should retrieve events and markets, preserve native identifiers and raw titles, record when each response was collected, and follow pagination until the data set is complete. Partial pagination can hide the very market needed for a comparison.

Kalshi’s documented public-data flow provides a concrete example: retrieve a series, list open markets filtered by its series ticker, retrieve event details, then request a market orderbook. The quickstart uses Python requests and notes cursor-based pagination. Store the cursor and response metadata so an interrupted collection can be diagnosed rather than silently treated as complete.

2. Establish contract identity before matching prices

Do not pair contracts merely because their titles look alike. Preserve the source title and official rules, then normalize the details that determine the payout:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Underlying event and the exact question being resolved.
  • Threshold, measurement method, and any relevant units.
  • Time window, deadline, and time zone.
  • Geography or population covered, where applicable.
  • Resolution authority, evidence source, and treatment of ambiguous outcomes.
  • Which outcome each venue labels YES and NO.

Only compare markets after a deliberate equivalence check. If one rule, deadline, or resolution source differs, mark the pair for review rather than treating it as a hedge. Keep a match record with the normalized fields, links or stored copies of the official rules, and the reason for the match; have a person review uncertain matches.

3. Normalize orderbooks without losing depth

Use one internal representation for every venue, such as outcome, side, price, quantity, and observation time. Keep the venue’s original levels as well as the normalized view so that a conversion error can be traced.

Kalshi’s official market-data quickstart says its binary-market orderbook returns bids only because YES and NO positions are reciprocal. A bid is not an ask. Under the binary payout relationship, a NO bid implies a complementary YES ask at the corresponding price complement; a YES bid implies a complementary NO ask. Apply the venue’s documented price units and contract semantics, and test the conversion against current examples before using it for orders. Preserve every level and its size: a best price alone does not tell you how much can be executed there.

Calculate an executable candidate, not a headline spread

For equivalent binary contracts, a simple starting case is buying YES on one venue and NO on another. If both contracts pay one unit for complementary outcomes under the same resolution rules, the gross paired margin per matched unit is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

gross margin = 1 − executable YES cost − executable NO cost

The executable costs must come from the asks available for the intended size, not last trades or midpoints. For a multi-level book, consume levels in price order until the intended quantity is reached, and compute the quantity-weighted cost on each venue. If either book cannot supply the requested quantity, reduce the paired size or reject the candidate.

Then subtract venue-specific fees and any explicit safety allowance for slippage, stale quotes, or other execution costs:

estimated net margin = gross margin − fees − safety allowance

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This is a model, not a universal formula: actual payouts, price units, fee treatment, and tradable quantities depend on the contracts and venue rules. The documentation covered here does not establish current fee schedules. Look them up in each venue’s official materials and model the fee applicable to the specific order and market; do not insert a guessed rate.

For each candidate, record both legs’ prices, quantities, quote ages, estimated fees, net margin, and the contract-match record. Set a minimum margin that includes your uncertainty allowance. If you cannot estimate a material cost or validate the settlement equivalence, label the result incomplete rather than profitable.

Keep collection separate from trading

Start with read-only alerts

Run the data collectors without trading credentials, save timestamped snapshots, and emit alerts for candidates. This lets you check contract matching, price conversion, pagination, quote freshness, and fee calculations without exposing funds to a code path that has not been validated.

Use stale-data limits and exposure limits from the start. Suppress an alert if a required market is missing, a cursor has not been fully followed, a quote is older than your configured limit, or an orderbook cannot support the proposed size. Log API errors and rejected candidates with a reason, not just the candidates that pass.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Add authenticated execution only as a separate, explicit step

Trading is a different system from scanning. Polymarket’s quickstart documents a Python path using AsyncSecureClient, market retrieval, outcome-identifier selection based on market version, a market buy, and asynchronous settlement. It says the market order consumes available liquidity and cancels any unfilled amount rather than leaving that amount open. Your execution logic must therefore not assume an unfilled remainder stays on the book.

Kalshi’s authenticated-request guide requires an API key ID, a millisecond timestamp, and a signature. It describes signing a message made from the timestamp, HTTP method, and path without query parameters, using RSA-PSS/SHA-256 or Ed25519. Keep this authenticated workflow separate from public market-data collection, protect private keys, and never put credentials in source code or logs. The guide describes demo and production environments; follow the current official instructions for the environment you intend to use.

Each venue has its own order identifiers, cancellation behavior, and settlement process. Implement explicit states for submitted, partially filled, filled, canceled, and failed orders; reconcile those states with venue responses before treating a two-leg position as complete. An order accepted on one side does not mean the other side filled.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Design for one-leg and data failures

A price gap can disappear between observation and order submission. One leg may fill while the other is rejected, only partly filled, or no longer available. That creates exposure rather than a locked-in paired return.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Set a maximum unhedged quantity and a response plan before enabling live orders.
  • Use a quote-age threshold and discard candidates when either side is stale.
  • Recheck depth and price immediately before any order submission.
  • Define how the system will react to partial fills, timeouts, rejected orders, and cancellation failures.
  • Track collateral committed on each venue and the funds unavailable until settlement.
  • Alert on incomplete pagination, API errors, clock problems, and unexpected order or position states.

These controls do not eliminate market or operational risk. They make the scanner’s assumptions visible and prevent an alert from being mistaken for a guaranteed outcome.

A practical build order

  1. Document the contracts. Choose a small set of markets and write down each venue’s rules, payout, outcome mapping, and resolution conditions.
  2. Implement read-only adapters. Retrieve events, markets, and orderbooks; preserve native IDs, timestamps, response data, and pagination state.
  3. Test normalization. Convert each venue’s book into common executable-side prices while retaining level sizes. Specifically validate Kalshi’s bid-only reciprocal representation.
  4. Build a match review queue. Compare normalized contract fields, but require a review for unresolved differences rather than matching on text similarity alone.
  5. Compute size-aware candidates. Sweep depth for the intended quantity, apply the verified fee model, and reject stale or incomplete inputs.
  6. Run alerts and reconcile snapshots. Log why a candidate passed or failed and compare subsequent observations with the original inputs.
  7. Consider live execution only after the controls are explicit. Add venue-specific authentication and order-state handling as a separate component; keep a defined limit on unhedged exposure.

What the scanner can—and cannot—tell you

A well-designed scanner can surface a price discrepancy that merits examination. It can also show whether the books appear to support a proposed size under your fee and staleness assumptions. It cannot make two different contracts equivalent, guarantee a fill on both venues, or establish that a displayed edge survives settlement, capital, jurisdictional, and operational constraints.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.