DEV Community

simplefunctions
simplefunctions

Posted on • Originally published at simplefunctions.dev

Kalshi vs Polymarket: A Developer's Guide to Both APIs

If you're building anything on prediction markets — a bot, a dashboard, an AI agent — your first decision is: Kalshi or Polymarket? I've built on both. Here's what I wish I knew upfront.

The Basics

Kalshi Polymarket
Regulation CFTC (US) Unregulated (crypto)
Settlement USD bank account USDC on Polygon
Auth RSA-PSS signatures EIP-712 + HMAC
Main volume Sports (90%) Crypto + geopolitics
Rate limits ~100 req/10s 15,000 req/10s

Market Discovery

Kalshi uses Series → Events → Markets. Search by series ticker:

curl "https://api.elections.kalshi.com/trade-api/v2/series?include_volume=true"
Enter fullscreen mode Exit fullscreen mode

Polymarket uses Events → Markets with the Gamma API:

curl "https://gamma-api.polymarket.com/events?active=true&limit=50"
Enter fullscreen mode Exit fullscreen mode

Orderbook Data

Both expose full orderbook depth. The key difference:

Kalshi returns YES/NO dollar prices:

{ "yes_bid_dollars": "0.48", "no_bid_dollars": "0.53" }
Enter fullscreen mode Exit fullscreen mode

YES ask = 100 - NO bid. Mental math required.

Polymarket returns direct probabilities:

{ "bids": [{"price": "0.48", "size": "500"}], "asks": [{"price": "0.52", "size": "300"}] }
Enter fullscreen mode Exit fullscreen mode

Price History

Kalshi: authenticated candlestick API, OHLC, custom date ranges. Requires API keys.

Polymarket: public OHLC endpoint, no auth:

curl "https://clob.polymarket.com/ohlc?asset_id=TOKEN_ID&startTs=1710000000&fidelity=1h"
Enter fullscreen mode Exit fullscreen mode

Liquidity Comparison

In practice, across 18 market categories:

  • Crypto: Polymarket wins (5-10x more depth)
  • Macro/geopolitics: Roughly equal
  • Sports: Kalshi dominates

The Practical Answer

Don't choose one. Use both. The best edges come from cross-venue comparison.

I built SimpleFunctions CLI for exactly this — one command to query both:

npm install -g @spfunctions/cli
sf scan "oil recession"          # search both venues
sf book KXWTIMAX-26DEC31-T135    # Kalshi orderbook depth
sf book --poly "oil price"       # Polymarket orderbook
sf liquidity crypto              # cross-venue liquidity scan
Enter fullscreen mode Exit fullscreen mode

It's open source, handles all the auth/normalization, and also has an MCP server for Claude Code:

claude mcp add simplefunctions --url https://simplefunctions.dev/api/mcp/mcp
Enter fullscreen mode Exit fullscreen mode

What are you building on prediction markets? Happy to answer questions.

Top comments (0)