# Polymarket & Kalshi Odds, Orderbook & Arbitrage Intel (`conscious_chuckwalla/prediction-market-arb-intel`) Actor

Real-time Polymarket & Kalshi odds, live L2 orderbook depth, $1k VWAP slippage, fee-adjusted cross-venue arbitrage signals, intra-event mispricings, and near-expiry prediction bonds. Zero CAPTCHA, 100% public APIs, AI Agent & MCP ready.

- **URL**: https://apify.com/conscious_chuckwalla/prediction-market-arb-intel.md
- **Developed by:** [Larry Wong](https://apify.com/conscious_chuckwalla) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 normalized market records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Polymarket & Kalshi Live Odds, Orderbook & Arbitrage Intelligence

Real-time cross-venue prediction market intelligence across **Polymarket** (Gamma + CLOB) and **Kalshi** (CFTC-regulated Trade API v2). Designed for **quantitative traders, prediction-market arbitrage bots, macro research desks, and AI Agents (via Apify MCP)**.

> **100% Public Read-Only APIs · Zero CAPTCHA · Zero Browser Overhead · Runs in ~10s on 256 MB RAM**

***

### Why Use This Actor Instead of Raw API Scripts?

Building reliable cross-venue prediction market analytics from scratch requires solving five notoriously fragile engineering problems—all handled out of the box here:

1. **Unified Canonical Schema Across Both Exchanges**: Automatically parses Polymarket's stringified JSON fields (`outcomes`, `outcomePrices`, `clobTokenIds`), live 2026 `feeSchedule` probability-scaled fees (`rate * (p * (1 - p))^exponent`), and Kalshi's 2026 fixed-point dollar schema (`*_dollars`, `*_fp`), while filtering out Kalshi `KXMVE*` multivariate parlay combo spam.
2. **False-Positive-Resistant Cross-Venue Matcher**: Combines accent folding (`Édouard Philippe` = `Edouard Philippe`), canonical event-family matching (Fed FOMC Decisions, US/French Elections, NBA/NFL/UCL/NHL Championships, BTC ranges, CPI, Recession), team/candidate aliases, and hard structural guards (year, month, generational suffix `Jr./Sr.`, price threshold, and cut-vs-hike polarity) to pair identical contracts 1-to-1 with confidence scoring.
3. **Exact Fee-Adjusted Arbitrage Math**: Evaluates both cross-venue synthetic-box legs (`Buy PM YES + Buy Kalshi NO` and `Buy Kalshi YES + Buy PM NO`), subtracts live Polymarket `feeSchedule` fees and Kalshi parabolic taker fees (`0.07 * p * (1 - p)`), and ranks signals into `executable_net_arb`, `gross_arb_pre_fee`, and `probability_divergence`.
4. **Live Level-2 Orderbook Depth & `$1,000` VWAP Slippage**: Fetches live Polymarket CLOB orderbooks (properly handling Polymarket's descending ask array) and Kalshi L2 orderbooks (inverting NO bids into YES asks) to compute top-5 depth, depth within 2%, orderbook imbalance, and exact `$1,000` fill slippage in basis points.
5. **Intra-Event Multi-Outcome & High-Yield Bond Scanners**: Detects mutually-exclusive multi-outcome events whose asks sum below `$1.00` (underround) or bids sum above `$1.00` (overround) with explicit catch-all exhaustiveness flags, plus near-expiry high-conviction carry ("prediction bond") yields.

***

### Intelligence Modes

| Mode | Output Record Types | Best For |
|---|---|---|
| `all` *(default)* | `cross_venue_arbitrage`, `intra_event_arbitrage`, `market` | Full market + alpha snapshot for dashboards & AI agents |
| `arbitrage` | `cross_venue_arbitrage`, `intra_event_arbitrage` | Automated arbitrage alert pipelines & scheduled scans |
| `markets` | `market` | Clean normalized live odds, spreads, 24h volume & L2 orderbooks |
| `yield_bonds` | `yield_bond` | Near-expiry high-probability (`85%–99%`) annualized carry screening |

***

### Real Live Sample Output

#### 1. Cross-Venue Arbitrage Signal (`record_type: "cross_venue_arbitrage"`)

```json
{
  "record_id": "cross_arb:561975:KXPRESNOMR-28-MR",
  "record_type": "cross_venue_arbitrage",
  "captured_at": "2026-11-24T15:07:59Z",
  "venue": "polymarket+kalshi",
  "category": "Politics",
  "event_title": "Republican Presidential Nominee 2028",
  "question": "Marco Rubio",
  "signal_tier": "executable_net_arb",
  "best_strategy_code": "BUY_PM_YES_AND_KALSHI_NO",
  "best_strategy": "Buy YES on Polymarket @ $0.1870 + Buy NO on Kalshi @ $0.7700",
  "gross_combined_cost": 0.957,
  "gross_arb_edge_bps": 430.0,
  "estimated_total_fees_bps": 200.0,
  "net_arb_edge_bps": 230.0,
  "roi_gross_pct": 4.49,
  "roi_net_pct": 2.35,
  "annualized_net_roi_pct": 1.2,
  "mid_price_divergence_bps": 490.0,
  "volume_24h_usd": 84219.71,
  "days_to_expiry": 714.58,
  "match_confidence": 0.98,
  "match_method": "canonical_family:us_pres_nom_rep",
  "resolution_risk_note": "Cross-venue settlement rules differ (Polymarket UMA optimistic oracle vs Kalshi CFTC-regulated rules); confirm identical resolution date and edge cases before sizing.",
  "polymarket_leg": {
    "market_id": "561975",
    "yes_bid": 0.185,
    "yes_ask": 0.187,
    "yes_mid": 0.186,
    "no_ask": 0.815,
    "volume_24h_usd": 44885.57,
    "liquidity_usd": 237106.82,
    "taker_fee_usd": 0.0076,
    "orderbook": {
      "best_bid": 0.185,
      "best_ask": 0.187,
      "bid_depth_top5_usd": 1816.32,
      "ask_depth_top5_usd": 658.61,
      "bid_depth_within_2pct_usd": 9672.1,
      "ask_depth_within_2pct_usd": 4554.3,
      "book_imbalance": 0.4678,
      "slippage_1000usd_bps": 44.4
    }
  },
  "kalshi_leg": {
    "ticker": "KXPRESNOMR-28-MR",
    "yes_bid": 0.23,
    "yes_ask": 0.24,
    "yes_mid": 0.235,
    "no_ask": 0.77,
    "volume_24h_contracts": 39334.14,
    "open_interest": 3791657.45,
    "taker_fee_usd": 0.0124,
    "orderbook": {
      "best_bid": 0.23,
      "best_ask": 0.24,
      "bid_depth_top5_usd": 33654.74,
      "ask_depth_top5_usd": 80552.85,
      "bid_depth_within_2pct_usd": 30221.68,
      "ask_depth_within_2pct_usd": 55992.38,
      "book_imbalance": -0.4106,
      "slippage_1000usd_bps": 0.0
    }
  }
}
```

#### 2. Unified Normalized Market (`record_type: "market"`)

```json
{
  "record_id": "market:polymarket:new-nvidia-ceo-named-by-december-31-2026",
  "record_type": "market",
  "captured_at": "2026-11-24T15:07:59Z",
  "venue": "polymarket",
  "category": "Tech & AI",
  "event_title": "New NVIDIA CEO named by December 31, 2026?",
  "yes_bid": 0.999,
  "yes_ask": null,
  "yes_mid": 0.9995,
  "spread_bps": 10.0,
  "volume_24h_usd": 3462573.28,
  "liquidity_usd": 1916224.79,
  "price_change_1d": 0.654,
  "days_to_expiry": 37.58,
  "fee_model": "polymarket_clob",
  "taker_fee_rate": 0.05,
  "url": "https://polymarket.com/event/new-nvidia-ceo-named-by-december-31-2026",
  "orderbook": {
    "best_bid": 0.999,
    "best_ask": null,
    "bid_depth_top5_usd": 1803896.23,
    "bid_depth_within_2pct_usd": 1813755.23,
    "book_imbalance": 1.0,
    "bid_levels": 40
  }
}
```

***

### Use With AI Agents (Apify MCP Server)

Connect this Actor directly to **Claude Desktop, Cursor, Windsurf, OpenAI Agents, or LangGraph** using the official Apify MCP Server so your AI agent can query live Polymarket & Kalshi spreads on demand:

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/actors-mcp-server",
        "--actors",
        "conscious_chuckwalla/prediction-market-arb-intel"
      ],
      "env": {
        "APIFY_TOKEN": "YOUR_APIFY_API_TOKEN"
      }
    }
  }
}
```

Example agent prompt:

> *"Run `prediction-market-arb-intel` in `arbitrage` mode with `searchQuery: "Fed"` and `includeOrderbookDepth: true`. Summarize every cross-venue Polymarket vs Kalshi opportunity with positive fee-adjusted net edge and highlight $1,000 execution slippage."*

***

### Programmatic Usage (Python & JavaScript)

#### Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("conscious_chuckwalla/prediction-market-arb-intel").call(
    run_input={
        "mode": "arbitrage",
        "venues": ["polymarket", "kalshi"],
        "minDivergenceBps": 50,
        "includeOrderbookDepth": True,
        "maxOrderbookEnrichments": 20,
        "maxResults": 50,
    }
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["event_title"], item["question"], item["net_arb_edge_bps"], item["best_strategy"])
```

#### Standalone Local Execution (No Apify Credentials Needed)

```bash
pip install httpx pytest
python -m src
## Output saved automatically to storage/datasets/default/ and storage/key_value_stores/default/SUMMARY.json
```

***

### Transparent Pricing Model (Pay-Per-Event)

This Actor uses Apify's **Pay-Per-Event (PPE)** billing so you only pay for the exact intelligence delivered—with zero idle compute bills and full support for Apify spending limits:

| Event Name | Price (USD) | Equivalent Rate | Description |
|---|---:|---:|---|
| `actor-start` | `$0.005` | `$5.00 / 1,000 runs` | Flat initialization fee per live scan |
| `market-record` | `$0.001` | `$1.00 / 1,000 markets` | Per normalized Polymarket or Kalshi contract emitted |
| `orderbook-enrichment` | `$0.002` | `$2.00 / 1,000 books` | Per live CLOB / Kalshi L2 orderbook + `$1k` VWAP slippage lookup |
| `arbitrage-signal` | `$0.010` | `$10.00 / 1,000 signals` | Per verified cross-venue arbitrage, intra-event mispricing, or yield bond |

*Example run cost*: A targeted `arbitrage` scan returning 20 verified cross-venue pairs with 10 live orderbooks costs **`$0.225`**. A lightweight `markets` scan returning 100 live contracts without orderbooks costs **`$0.105`**.

*(Alternative Pay-Per-Result pricing tier if preferred: `$2.50 / 1,000 dataset results` flat.)*

***

### Compliance, Data Ethics & Risk Disclaimer

- **100% Legal Public Market Data**: Queries exclusively official unauthenticated read-only market-data REST endpoints (`gamma-api.polymarket.com`, `clob.polymarket.com`, `api.elections.kalshi.com/trade-api/v2`). No logins, no CAPTCHA bypassing, no private user scraping, and no copyrighted editorial content.
- **Not Financial Advice**: Cross-venue prediction markets carry settlement rule differences (Polymarket UMA optimistic oracle vs. Kalshi CFTC-regulated rulebooks), timing/finality differences, and execution slippage. Always verify exact market rules and live orderbook depth before trading.

# Actor input Schema

## `mode` (type: `string`):

Select which intelligence records to emit to the dataset. 'all' emits cross-venue arbitrage pairs, intra-event mispricings, and top unified markets. 'arbitrage' focuses solely on cross-venue & intra-event alpha signals. 'markets' outputs normalized odds & orderbooks. 'yield_bonds' scans near-expiry high-probability contracts with attractive annualized yield.

## `venues` (type: `array`):

Exchanges to query in real time via their official public read-only APIs. Include both for cross-venue arbitrage detection.

## `searchQuery` (type: `string`):

Case-insensitive keyword filter applied to event titles, market questions, categories, and tags (e.g., 'Fed', 'Bitcoin', 'NBA', 'French', 'CPI', 'NVIDIA'). Leave blank to scan all top active markets.

## `categories` (type: `array`):

Optional list of categories or tags to keep (e.g., 'Economics', 'Politics', 'Crypto', 'Sports', 'Tech', 'Science'). Leave empty to include all categories.

## `maxResults` (type: `integer`):

Hard cap on total records pushed to the dataset (protects user budget under Pay-Per-Event pricing).

## `polymarketEventLimit` (type: `integer`):

Number of highest 24h-volume active Polymarket events to ingest from the Gamma API.

## `kalshiSeriesTickers` (type: `array`):

High-liquidity Kalshi series tickers to ingest alongside general open-market discovery. Default set covers Fed decisions, CPI, Recession, US/French elections, NBA/NFL/UCL/NHL, Crypto, and AI.

## `kalshiGeneralMarketPages` (type: `integer`):

Additional pages (200 open non-parlay markets per page) fetched from Kalshi's general /markets endpoint to catch trending non-series contracts.

## `minVolume24h` (type: `number`):

Filter out illiquid markets below this 24-hour trading volume threshold.

## `minYesProb` (type: `number`):

Keep markets whose YES mid-price is at least this value (0.00 to 1.00).

## `maxYesProb` (type: `number`):

Keep markets whose YES mid-price is at most this value (0.00 to 1.00).

## `minDivergenceBps` (type: `number`):

Emit cross-venue pairs whenever either gross arbitrage edge > 0 OR absolute YES mid-price divergence is at least this many basis points (100 bps = 1.00%).

## `minMatchConfidence` (type: `number`):

Strict semantic + structural similarity floor (0.50–1.00) required before pairing a Polymarket contract with a Kalshi contract.

## `includeOrderbookDepth` (type: `boolean`):

Fetches live CLOB orderbooks (Polymarket) and Level-2 orderbooks (Kalshi) for top markets and arbitrage legs to compute top-5 depth, 2% depth, book imbalance, and exact $1,000 fill slippage.

## `maxOrderbookEnrichments` (type: `integer`):

Upper bound on live L2 orderbook API requests per run to keep latency fast and Pay-Per-Event costs predictable.

## `yieldMinProb` (type: `number`):

Used in 'yield_bonds' mode: minimum side ask probability (e.g. 0.85 = 85% conviction).

## `yieldMaxDaysToExpiry` (type: `integer`):

Used in 'yield_bonds' mode: maximum days until market close/resolution.

## `sortBy` (type: `string`):

Sort criterion for emitted market records.

## Actor input object example

```json
{
  "mode": "all",
  "venues": [
    "polymarket",
    "kalshi"
  ],
  "searchQuery": "",
  "categories": [],
  "maxResults": 100,
  "polymarketEventLimit": 60,
  "kalshiSeriesTickers": [
    "KXFEDDECISION",
    "KXFED",
    "KXCPI",
    "KXRECSSNBER",
    "KXPAYROLLS",
    "KXGDP",
    "KXPRESNOMD",
    "KXPRESNOMR",
    "KXPRESPERSON",
    "KXFRENCHPRES",
    "KXNEXTSPEAKER",
    "KXSB",
    "KXNBA",
    "KXUCL",
    "KXNHL",
    "KXMLB",
    "KXBTCMINY",
    "KXBTCMAXY",
    "KXBTC",
    "KXETH",
    "KXAGICO",
    "KXTOPMODEL"
  ],
  "kalshiGeneralMarketPages": 2,
  "minVolume24h": 500,
  "minYesProb": 0,
  "maxYesProb": 1,
  "minDivergenceBps": 50,
  "minMatchConfidence": 0.8,
  "includeOrderbookDepth": true,
  "maxOrderbookEnrichments": 20,
  "yieldMinProb": 0.85,
  "yieldMaxDaysToExpiry": 90,
  "sortBy": "volume_24h"
}
```

# Actor output Schema

## `overviewTable` (type: `string`):

Unified overview table combining cross-venue arbitrage signals, intra-event mispricings, and top liquid markets.

## `arbitrageView` (type: `string`):

Filtered view highlighting matched Polymarket vs Kalshi spreads, fee-adjusted net edge, and execution legs.

## `marketsView` (type: `string`):

Normalized Polymarket and Kalshi contract odds, spreads, 24h volume, and CLOB depth metrics.

## `rawDataset` (type: `string`):

Complete unprojected JSON records for downstream pipelines, quant notebooks, and AI agents.

## `executiveSummary` (type: `string`):

Run metadata, venue counts, top arbitrage highlights, and Pay-Per-Event billing ledger.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "venues": [
        "polymarket",
        "kalshi"
    ],
    "searchQuery": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("conscious_chuckwalla/prediction-market-arb-intel").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "venues": [
        "polymarket",
        "kalshi",
    ],
    "searchQuery": "",
}

# Run the Actor and wait for it to finish
run = client.actor("conscious_chuckwalla/prediction-market-arb-intel").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "venues": [
    "polymarket",
    "kalshi"
  ],
  "searchQuery": ""
}' |
apify call conscious_chuckwalla/prediction-market-arb-intel --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,conscious_chuckwalla/prediction-market-arb-intel"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/t7gzsUZ0bxyN3pjhL/builds/ofkqdNODYg36matkH/openapi.json
