SuperAPI AI Directory

prediction-market-arbitrage-zh

Data & analytics

View repository

Updated 10-15 19:53

About this skill

Prediction Market Arbitrage

Through AIsa API discover Polymarket between Kalshi and

Setup

export AISA_API_KEY="your-key"

Get a Key at aisa.one ($0.01 per query, pay-as-you-go).

Workflow

Steps to discover arbitrage opportunities:

  1. Scan matching markets(scan batch scan,match analyze specific markets)
  2. View spreads — the tool automatically calculates cross-platform price differences
  3. Verify liquidity — use prediction_market_client.py orderbooks to check order book depth before acting

Quick Examples

Scan a sport for arbitrage opportunities

# 扫描指定日期所有 NBA 市场 — 自动显示价差
python3 scripts/arbitrage_finder.py scan nba --date 2025-04-01

Analyze a specific market

# 通过 Polymarket slug
python3 scripts/arbitrage_finder.py match --polymarket-slug <slug>

# 通过 Kalshi ticker
python3 scripts/arbitrage_finder.py match --kalshi-ticker <ticker>

Verify liquidity before acting

# 检查两边的订单簿深度
python3 scripts/prediction_market_client.py polymarket orderbooks --token-id <id>
python3 scripts/prediction_market_client.py kalshi orderbooks --ticker <ticker>

Command Reference

arbitrage_finder.py — automatic detection

python3 scripts/arbitrage_finder.py scan <运动类型> --date <YYYY-MM-DD> [--min-spread <百分比>] [--min-liquidity <美元>] [--json]
python3 scripts/arbitrage_finder.py match --polymarket-slug <slug> [--min-spread <百分比>] [--min-liquidity <美元>] [--json]
python3 scripts/arbitrage_finder.py match --kalshi-ticker <ticker> [--min-spread <百分比>] [--min-liquidity <美元>] [--json]

Supported:nba、nfl、mlb、nhl、soccer、tennis。

prediction_market_client.py — raw market data

For manual price checks and in-depth analysis.

# 搜索市场
python3 scripts/prediction_market_client.py polymarket markets --search <关键词> --status open --limit 5
python3 scripts/prediction_market_client.py kalshi markets --search <关键词> --status open --limit 5

# 获取价格(使用 markets 输出中的 token_id / market_ticker)
python3 scripts/prediction_market_client.py polymarket price <token_id>
python3 scripts/prediction_market_client.py kalshi price <market_ticker>

# 跨平台体育市场匹配
python3 scripts/prediction_market_client.py sports by-date <运动类型> --date <YYYY-MM-DD>
python3 scripts/prediction_market_client.py sports matching (--polymarket-slug <slug> | --kalshi-ticker <ticker>)

# 订单簿深度
python3 scripts/prediction_market_client.py polymarket orderbooks --token-id <id>
python3 scripts/prediction_market_client.py kalshi orderbooks --ticker <ticker>

Understanding Arbitrage

An arbitrage opportunity exists when the combined cost of all mutually exclusive outcomes across different platforms is less than 1.0 :

"Yes" price on Polymarket 0.40 + "No" price on Kalshi 0.55 = cost 0.95, guaranteed return 1.00 → 5.3% profit.

Always verify order book depth — a spread without liquidity cannot be executed.

Security and Permissions

Required: AISA_API_KEY environment variable.

All operations areread-only, via HTTPS GET requests to api.aisa.one. Arbitrage spreads are calculated locally. No trades are executed, no wallet is connected, and no personal data is sent except the API Key. Each response includes usage.cost and usage.credits_remaining。

Full documentation:AIsa API Reference。