# Polymarket Scraper, Arbitrage, Whale Tracker & Liquidity API (`cetus/polymarket-intelligence-mcp`) Actor

Real-time Polymarket prediction market scraper & quantitative API: CLOB L2 orderbook depth, Liquidity Rewards APY/ROI scanner, multi-outcome NegRisk sum-of-odds arbitrage finder & live Whale Trades smart-money tracker. Exact fixed-point USD math in native Rust + MCP Server for AI agents.

- **URL**: https://apify.com/cetus/polymarket-intelligence-mcp.md
- **Developed by:** [Cetus Lab](https://apify.com/cetus) (community)
- **Categories:** MCP servers, Agents, Automation
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 quantitative intelligence records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/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 Scraper, Arbitrage, Liquidity Rewards, Whales & MCP Server

Institutional-grade **Polymarket quantitative intelligence engine and Model Context Protocol (MCP) Server** built in native **Rust** by **Cetus Lab**.

While basic scrapers only dump market titles, this engine connects directly to Polymarket's **CLOB L2 Orderbooks**, **Gamma Events**, and **Live Trade Tape** using **exact fixed-point decimal arithmetic** (zero floating-point rounding drift) inside a **128 MB RAM** container (`< 10 MB` actual memory, sub-10ms cold start).

***

### 4 Quantitative Scanners + Real-Time AI MCP Server in One Tool

#### 1. Liquidity Rewards ROI & L2 Shield Scanner (`scanMode: "liquidity_rewards"`)

Built for automated market makers and LP yield hunters:

- Extracts active **`dailyRewardUsd`**, **`rewardMaxSpreadCents`**, and **`rewardMinSize`** parameters.
- Inspects live L2 orderbooks to compute exact **Bid Shield USD** and **Ask Shield USD** resting inside the incentive spread window (or `±3c` around midpoint).
- Ranks markets by **`estimatedDailyYieldBps`** (estimated daily USDC yield in basis points per `$1,000` of balanced two-sided quoting competing in the incentive band).

#### 2. Multi-Outcome `NegRisk` Arbitrage & Sum-of-Odds Scanner (`scanMode: "negrisk_arbitrage"`)

Scans mutually exclusive multi-outcome events (`negRisk: true`) where exactly one outcome resolves to `$1.00`:

- Computes exact fixed-point **`sumBestAsk`** and **`sumBestBid`** across all active YES legs.
- Flags **`BUY_ALL_YES_BASKET`** arbitrage when `sumBestAsk < $1.0000` (buy 1 share of every outcome for less than `$1.00` payout) and **`OVERPRICED_BASKET_MERGE`** when `sumBestBid > $1.0000`, reporting exact **`arbitrageEdgeBps`** and top-of-book executable size.

#### 3. Active Markets + L2 Microstructure (`scanMode: "markets_l2"`)

- Live **`bestBid`**, **`bestAsk`**, **`midpoint`**, **`spreadBps`**, **`bidShieldUsd`**, **`askShieldUsd`**, and **`orderbookImbalance`** (`[-1.0000 .. +1.0000]`) showing real buying vs. selling pressure in the orderbook.

#### 4. Live Whale Trades & Smart Money Flow (`scanMode: "whale_trades"`)

- Filters the live Polygon/CLOB trade feed above `minWhaleUsd` (e.g. `$2,500+`, `$10,000+`, `$50,000+`), capturing exact **`whaleNotionalUsd`**, **`whaleSide`** (`BUY` / `SELL`), **`whaleOutcome`**, trader **`pseudonym` / `proxyWallet`**, and **`transactionHash`**.

***

### Native MCP Server for Claude Desktop, Cursor, n8n & Make

Connect your AI agent directly to the Apify Standby Streamable-HTTP endpoint (`/mcp`) to unlock 4 live quantitative tools:

- `scan_polymarket_markets_l2` — Search markets with live CLOB L2 depth, spread, and orderbook imbalance.
- `rank_liquidity_rewards` — Rank top market-making reward pools by yield vs. L2 wall thickness.
- `scan_negrisk_arbitrage` — Detect multi-outcome sum-of-asks / sum-of-bids mispricings in real time.
- `get_whale_trades` — Query recent high-conviction whale trades filtered by USD size and keyword.

***

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

- **`intel-record`** (*Primary Event*): charged **only after** each validated quantitative signal record is written to your Dataset or delivered via MCP.

# Actor input Schema

## `scanMode` (type: `string`):

Choose which quantitative scanner to run (or 'all_in_one' for a combined snapshot of L2 markets, Liquidity Rewards, NegRisk arbitrage, and Whale trades).

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

Filter markets, events, or whale trades by keyword (e.g. 'Fed', 'Bitcoin', 'Trump', 'Election', 'AI').

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

Maximum number of quantitative intelligence records to output.

## `minLiquidityUsd` (type: `integer`):

Minimum market liquidity threshold in USD for market and rewards scans.

## `minDailyRewardUsd` (type: `integer`):

Minimum daily USDC reward pool when scanning 'liquidity_rewards'.

## `minWhaleUsd` (type: `integer`):

Minimum single-trade notional value in USD when tracking whale flow.

## `minArbitrageBps` (type: `integer`):

Minimum deviation from $1.0000 (1 bp = 0.01%) for multi-outcome NegRisk sum-of-asks / sum-of-bids alerts (set 0 to inspect all multi-outcome baskets).

## `concurrency` (type: `integer`):

Concurrent L2 orderbook requests (tuned for 128 MB RAM).

## Actor input object example

```json
{
  "scanMode": "all_in_one",
  "searchQuery": "",
  "maxResults": 30,
  "minLiquidityUsd": 1000,
  "minDailyRewardUsd": 20,
  "minWhaleUsd": 2500,
  "minArbitrageBps": 0,
  "concurrency": 8
}
```

# Actor output Schema

## `intelligence` (type: `string`):

No description

# 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 = {
    "scanMode": "all_in_one",
    "searchQuery": "",
    "maxResults": 30,
    "minLiquidityUsd": 1000,
    "minDailyRewardUsd": 20,
    "minWhaleUsd": 2500,
    "minArbitrageBps": 0,
    "concurrency": 8
};

// Run the Actor and wait for it to finish
const run = await client.actor("cetus/polymarket-intelligence-mcp").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 = {
    "scanMode": "all_in_one",
    "searchQuery": "",
    "maxResults": 30,
    "minLiquidityUsd": 1000,
    "minDailyRewardUsd": 20,
    "minWhaleUsd": 2500,
    "minArbitrageBps": 0,
    "concurrency": 8,
}

# Run the Actor and wait for it to finish
run = client.actor("cetus/polymarket-intelligence-mcp").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 '{
  "scanMode": "all_in_one",
  "searchQuery": "",
  "maxResults": 30,
  "minLiquidityUsd": 1000,
  "minDailyRewardUsd": 20,
  "minWhaleUsd": 2500,
  "minArbitrageBps": 0,
  "concurrency": 8
}' |
apify call cetus/polymarket-intelligence-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cetus/polymarket-intelligence-mcp"
        }
    }
}
```

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/F5JOoGlBS92s0TqVh/builds/R4z1bJjwJzVCISVP2/openapi.json
