Genesis Arbitrage

Genesis Arbitrage · · 14 min read

Polymarket API and Kalshi API: prices, order books and arbitrage between them

In short

  • Polymarket and Kalshi serve markets, prices and order books through official REST APIs with no key. A key and a signed request are needed to place orders, and on Kalshi also to open a WebSocket connection.
  • A contract price is a fraction of a dollar: 0.42 means 42¢ and roughly a 42% chance in the market's view. Only the order book shows what a given size will cost.
  • Arbitrage between platforms means matching events, checking resolution rules and dates, walking the order books and subtracting fees. The /predictions/arbitrage endpoint in Genesis API returns bundles with all of that computed; you place the trades yourself.

The Polymarket API and the Kalshi API are the official programming interfaces of two prediction market platforms: through them a program reads markets, YES and NO contract prices and order books, and with a key and a signed request it places orders. Market data on both platforms is readable without a key. For arbitrage between the two, prices are not enough: the events have to be matched and the profit worked out through the order books with fees. Ready-made bundles come from the /predictions/arbitrage endpoint in Genesis API.

How prediction market data is structured

A prediction market trades contracts on the outcome of an event. Every market is a yes-or-no question: a YES contract pays $1 if the event happens, and a NO contract pays $1 if it does not. How the platforms resolve markets and why their prices drift apart is covered in the article Prediction markets explained: how Polymarket and Kalshi work and the lesson What are prediction markets. Here is how the same objects look in the APIs.

PolymarketKalshi
Market groupEvent with one or more marketsSeries containing events
MarketBinary condition with Yes and No outcomesBinary market with a ticker
Outcome in the APIYes and No each have a token IDYES and NO sides of one market
Price$0.00 to $1.00Dollar string, e.g. "0.4200"
Order bookBids and asks for each outcomeYES bids and NO bids only

A price is a fraction of a dollar: 0.42 means 42¢ for a contract that pays $1 if its outcome happens. That is why the price reads as the market's estimate of probability, here roughly 42%. The Polymarket site displays the midpoint between the best bid and ask, or the last trade price when the spread is wider than $0.10 (Polymarket docs). To price a trade, you use the order book.

Order book: bids, asks and mirrored prices

An order book is the list of buy orders (bids) and sell orders (asks) with their prices and sizes. On Polymarket each outcome has its own book, requested by token_id. Kalshi returns only bids for both sides: a YES bid at price X equals a NO ask at $1.00 − X (Kalshi docs).

An illustrative example: the best NO bid on Kalshi is 0.58. So YES is on offer at 1 − 0.58 = 0.42, or 42¢.

Official Polymarket and Kalshi APIs

Polymarket

Polymarket data comes from three REST APIs and WebSocket streams (API overview). Market data, including CLOB prices and order books, needs no key.

APIWhat it gives you
Gamma APIEvents and markets: metadata, dates, outcome IDs
CLOB APIPrices and order books; with keys, orders
Data APIWallet positions and activity, price history
WebSocketMarket channel for books and prices; user channel for account orders and trades

Orders take two-step CLOB authentication: a wallet signature (L1) issues CLOB credentials (L2) that sign trading requests. The outcome ID for the book comes from the Gamma API: v1 markets carry it in the clobTokenIds JSON string, v2 markets in positionIds; index 0 is YES and 1 is NO (market fields). Instead of raw requests you can use the official Python SDK, the polymarket-client package.

Kalshi

For prediction markets Kalshi offers a REST API (Trade API v2), WebSocket and FIX. The recommended REST host is external-api.kalshi.com; the older api.elections.kalshi.com still works, and there is a separate demo environment for testing (API environments). Series, events, markets, order books and trades are public.

A trading request is signed with a private key (Ed25519 or RSA): the key ID, timestamp and signature go in the KALSHI-ACCESS-KEY, KALSHI-ACCESS-TIMESTAMP and KALSHI-ACCESS-SIGNATURE headers (Kalshi API keys). Market terms, including resolution rules, come as text in rules_primary and rules_secondary; best prices are in yes_bid_dollars, yes_ask_dollars, no_bid_dollars and no_ask_dollars.

When you need a key

WhatPolymarketKalshi
Markets, prices, books (REST)No keyNo key
Book stream (WebSocket)Market channel, no keyKey required, even for public channels
OrdersWallet signature and CLOB credentialsRequest signed with a private key

Reading an order book without a key: curl and Python

# Polymarket: the book of one outcome by token_id
curl "https://clob.polymarket.com/book?token_id=$TOKEN_ID"

# Kalshi: the book of a market by ticker
K=https://external-api.kalshi.com/trade-api/v2
curl "$K/markets/$TICKER/orderbook"

Polymarket returns bids and asks, levels with price and size as strings, plus tick_size and min_order_size. Kalshi returns an orderbook_fp object with yes_dollars and no_dollars arrays, where each level is a pair of dollar price and contract count.

What a given size costs only shows up when you walk the levels. This function walks Polymarket asks from the best one and returns the best, average and worst price:

import requests

CLOB = "https://clob.polymarket.com"


def walk_asks(token_id: str, shares: float):
    """Best, average and worst price to buy `shares` shares.

    The platform fee is not included here.
    """
    r = requests.get(f"{CLOB}/book", params={"token_id": token_id},
                     timeout=10)
    r.raise_for_status()
    left, cost, prices = shares, 0.0, []
    for level in reversed(r.json()["asks"]):  # the best ask is last
        price, size = float(level["price"]), float(level["size"])
        take = min(left, size)
        cost += take * price
        prices.append(price)
        left -= take
        if left <= 1e-9:
            return prices[0], round(cost / shares, 4), prices[-1]
    return None  # the book is too thin for the full size


print(walk_asks("TOKEN_ID_YES", 1000))

The average price here is the order's VWAP: the deeper a purchase goes into the book, the further it moves from the best price. That gap is slippage, and the volume resting near the best price is market depth.

What makes Polymarket–Kalshi arbitrage hard

Cross-platform prediction arbitrage means buying YES on one platform and NO on the other when together they cost less than $1: if both resolve the same way, one leg pays $1 whatever happens. Comparing two prices through the official APIs is easy; the pair becomes a trade only after five checks.

CheckWhy it is hard
Event matchingQuestions are worded differently, and IDs and structure differ: an event with markets on Polymarket, a series with events on Kalshi
Resolution rulesSource, wording and edge cases can differ under the same headline
Resolution datesMarkets close on different days; money stays locked until the later date
FeesDifferent formulas: on Polymarket only takers pay, on Kalshi the fee type is set per series
Book depthOnly a limited number of contracts sells at the best price

On Polymarket only the taker pays a fee, and the amount depends on the share price and market category (Polymarket fees). On Kalshi the fee type and multiplier live on the series, in the fee_type and fee_multiplier fields (series in the Kalshi API). You need funds on both platforms in advance, and access to each depends on your country and the platform's rules.

Worked example: YES on Polymarket, NO on Kalshi

An illustrative example: a market "Event X happens by December 31" is listed on both platforms with identical rules and resolves in 46 days. You want 1,000 shares of each side.

LegBook levelsCost
YES on Polymarket500 at 0.40 and 500 at 0.41200 + 205 = $405
NO on Kalshi600 at 0.55 and 400 at 0.56330 + 224 = $554

NO asks on Kalshi come from YES bids: a YES bid of 0.45 for 600 contracts is a NO ask at 0.55, and a 0.44 bid for 400 is an ask at 0.56.

At the best prices the pair costs 0.40 + 0.55 = 0.95: a 5¢ edge per share, or 0.05 / 0.95 = 5.26% on the money put in. The average fill prices through the books are 0.405 and 0.554, together 0.959, so the edge shrinks to 4.1¢. Fees in the example are $6 on Polymarket and $17 on Kalshi, $23 in total.

Profit is the payout minus the cost of both legs and the fees, and the annual rate (APR) follows from the days to resolution:

In the example: 1,000 − 959 − 23 = $18 of profit, 18 / 982 × 100 = 1.83% on the money put in, and 1.83 × 365 / 46 = 14.5% a year. Of the 5.26% at the best prices, about a third survives the books and fees.

If both platforms resolve the same way, one leg pays $1,000 whatever happens: $982 goes in and $18 more comes back. If the rules diverge and both legs lose, the loss is the full $982.

Prediction arbitrage in Genesis API

The /predictions/arbitrage endpoint returns bundles with that work already done. Markets on Polymarket, Kalshi, Limitless, Predict.fun and Opinion are matched, every leg is walked through its book with fees, and profit in $ and %, APR and days to resolution are computed. It is the data of the Prediction arbitrage page, as JSON.

modeWhat you getAPI plans
exactExactly matched events on two platforms, the defaultStart, Pro, Max
dutchYES on every outcome of one event on one platformStart, Pro, Max
llmEvent pairs verified by AIPro, Max
sportSurebets across 13 platforms, pre-match onlyPro, Max

The bundle from the example above would look like this in a response, fields trimmed:

{
  "kind": "cross",
  "match": "exact",
  "title": "Will event X happen by December 31?",
  "days_left": 46,
  "shares": 1000,
  "size_usd": 959,
  "fees_usd": 23,
  "profit_usd": 18,
  "profit_pct": 1.83,
  "apr_pct": 14.5,
  "risks": [],
  "legs": [
    {
      "platform": "polymarket",
      "side": "yes",
      "price_best": 0.4,
      "price_avg": 0.405,
      "price_worst": 0.41,
      "cost_usd": 405,
      "fee_usd": 6
    },
    {
      "platform": "kalshi",
      "side": "no",
      "price_best": 0.55,
      "price_avg": 0.554,
      "price_worst": 0.56,
      "cost_usd": 554,
      "fee_usd": 17
    }
  ]
}

In a leg, side says what to buy: yes, no or bet, a bookmaker stake. price_best, price_avg and price_worst are the best, average and worst prices walking the book; cost_usd and fee_usd are the leg's cost and fee; url links to the market. apr_pct is null when resolution is less than a day away.

Codes in risks flag what the math cannot check: rules_differ means the platforms' resolution rules may differ, end_mismatch means their resolution dates differ. In sport mode a bundle with a bookmaker leg has profit_usd = null, because the stake limit is unknown. Surebets are covered in the article on bookmaker odds APIs.

Filter bundles with min_profit_pct, min_profit_usd, min_apr, max_days, platform and category. All filters and fields are in the guide Prediction markets and surebets in Genesis API. Without code, the same bundles are on the service page; its columns and tags are explained in the guide Prediction arbitrage.

Platform status, analytics and trades

EndpointReturnsAPI plans
/predictions/platformsPlatform feed mode (ws, rest, down), time of latest quotes and full scan, market countStart, Pro, Max
/predictions/analyticsOpen interest and volume, price moves over 1h and 24h, money flowsPro, Max
/predictions/smart-moneyLarge trades and whales over 24h, insider patterns, position concentrationPro, Max
/predictions/tradesPolymarket trade tape: live from $1,000 and smart-wallet trades from $100, today and 7d takers from $5,000Pro, Max
/predictions/tradersTop 300 Polymarket traders by PnL over 30 days, 7 days or all timePro, Max

Request /predictions/platforms alongside the bundles: if a platform's feed is down, its prices in the bundles may be stale. Each trade on the tape carries wallet labels (tags), the insider flag, the taker or maker role and the outcome's current bid_now and ask_now. The insider label describes how a wallet behaves and proves nothing.

On Trial these endpoints return 403 plan_restricted. Start costs $50 a month and refreshes data every 30 s, Pro $100 and 10 s, Max $200 and 5 s. Compare plans on Genesis API pricing; the same screens on the site are Analytics and Smart Money.

Python: exact bundles with min_profit_pct and max_days

Every meta.freshness_sec seconds the script fetches exact bundles with at least 1% profit that resolve within 60 days. It skips bundles with a platform in down and prints the rest with their book-walk prices. The key comes from the GENESIS_API_KEY environment variable; how to get one is in the quick start.

import os
import time

import requests

API = "https://api.genesisarbitrage.com/v1"
HEADERS = {"X-API-Key": os.environ["GENESIS_API_KEY"]}
PARAMS = {"mode": "exact", "min_profit_pct": 1, "max_days": 60}


def get(path, params=None):
    while True:
        r = requests.get(f"{API}{path}", headers=HEADERS,
                         params=params, timeout=10)
        if r.status_code in (429, 503):
            wait = int(r.headers.get("Retry-After", "5"))
            if wait > 60:  # the period quota is used up
                raise SystemExit(f"Wait {wait} s: quota exhausted")
            time.sleep(wait)
            continue
        r.raise_for_status()  # 403: endpoint or mode not in your plan
        return r.json()


while True:
    feeds = get("/predictions/platforms")["data"]["platforms"]
    down = {p["platform"] for p in feeds if p["mode"] == "down"}
    body = get("/predictions/arbitrage", PARAMS)
    for b in body["data"]:
        if any(leg["platform"] in down for leg in b["legs"]):
            continue  # this platform's prices may be stale
        print(f"{b['profit_pct']}% · ${b['profit_usd']} · "
              f"APR {b['apr_pct']} · {b['days_left']} d · "
              f"{b['title'][:40]}")
        for leg in b["legs"]:
            print(f"  {leg['platform']} {leg['side']}: "
                  f"{leg['price_best']} / {leg['price_avg']} / "
                  f"{leg['price_worst']}, fee ${leg['fee_usd']}")
        if b["risks"]:
            print("  risks:", ", ".join(b["risks"]))
    time.sleep(body["meta"]["freshness_sec"])

Each cycle makes two calls. On Start that is 2 × 86,400 / 30 = 5,760 calls a day and 5,760 × 30 = 172,800 per 30 days against a 2M quota. A filtered response comes without an ETag, so the saving here is the polling interval: polling faster than meta.freshness_sec brings no new data. More in the guides Genesis API limits and responses and errors.

Questions and answers

Does Polymarket have an official API?

Yes. The Gamma API serves events and markets, the CLOB API prices, order books and orders, the Data API positions, activity and price history, and book updates stream over WebSocket. Market data needs no key; orders need a wallet signature and CLOB credentials. See the Polymarket docs.

Do I need a key to read Kalshi markets?

Not for REST: series, events, markets, order books and trades are public (Kalshi quick start). A key is required for orders and to connect to the WebSocket, even if you only want public channels.

Can I trade through Genesis API?

No. Genesis API only reads data and places no orders. You open a bundle yourself on the platforms via the legs[].url links. Automated trading through the official Polymarket and Kalshi APIs is outside Genesis API and at your own risk.

How often is the data updated?

Genesis API serves a new snapshot every meta.freshness_sec: 30 s on Start, 10 s on Pro and 5 s on Max. How fresh the platforms' own quotes are is shown by quotes_at and full_scan_at in /predictions/platforms.

Which Genesis API plan do I need for Polymarket and Kalshi arbitrage?

Start: it includes the exact and dutch modes and platform status. The llm and sport modes, analytics, smart money, trades and the trader leaderboard are on Pro and Max.