> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# 预测市场套利

> 使用当前已挂载的 Polymarket 和 Kalshi discovery endpoint 进行跨平台预测市场研究。

[在 GitHub 上查看 →](https://github.com/AIsa-team/agent-skills/tree/main/financial/prediction-market-arbitrage)

**用 AIsa 研究预测市场机会。** 一个 `AISA_API_KEY` 即可拉取已挂载的 Polymarket 和 Kalshi 市场发现数据，让智能体在使用交易所专用工具检查价格、订单簿深度或执行前，先识别候选事件。

## 安装

如果还没有安装 AIsa CLI，请先安装：

```bash theme={null}
npm install -g @aisa-one/cli
```

然后安装该技能：

```bash theme={null}
aisa skills install prediction-market-arbitrage
```

> [!NOTE]
>
> 需要中文版？安装 [`prediction-market-arbitrage-zh`](https://github.com/AIsa-team/agent-skills/tree/main/financial/prediction-market-arbitrage-zh)：基于当前已挂载的 Polymarket 和 Kalshi discovery endpoint 做跨市场候选研究，并以中文输出。
>
> ```bash theme={null}
> aisa skills install prediction-market-arbitrage-zh
> ```

## 智能体可以用它做什么？

> [card] 跨市场发现
>
> “查找 Polymarket 和 Kalshi 上相关的 NFL、宏观或选举市场。”

> [card] 候选配对
>
> “比较标题、event ticker、slug 和关闭时间，识别可能等价的市场。”

> [card] 流动性初筛
>
> “使用 discovery 响应中的成交量和流动性字段，决定优先深入检查哪些交易场所。”

> [card] 体育研究流程
>
> “从可用 Polymarket 和 Kalshi 市场 feed 构建当日候选列表。”

> [card] 选举与宏观
>
> “在执行交易所专用价格检查前，先找出可比较的事件市场。”

> [card] 执行准备
>
> “产出研究候选清单；执行和订单簿检查需直接在各交易场所完成。”

## 工作方式

**1. 发现候选市场**

查询 `/polymarket/markets`、`/polymarket/events` 和 `/kalshi/markets`，找到相关市场/事件记录。

**2. 配对可能等价的市场**

按标题、event ticker、slug、事件日期、运动/队伍名称或市场关闭时间匹配候选项。

**3. 在 AIsa 之外验证价格**

交易前使用交易所原生 API 或交易系统检查当前价格、订单簿深度和执行条件。

> [!WARNING]
>
> AIsa 当前挂载的是下方列出的 Prediction Market discovery 端点。旧版 AIsa-hosted `market-price`、`orderbooks` 和 `matching-markets` 路由示例已移除，因为鉴权探测返回 `api endpoint not found`。

## 快速开始

```bash theme={null}
export AISA_API_KEY="your-key"
```

### 1. 查找 Polymarket 候选

```bash theme={null}
curl "https://api.aisa.one/apis/v1/polymarket/markets?limit=5" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### 2. 查找 Kalshi 候选

```bash theme={null}
curl "https://api.aisa.one/apis/v1/kalshi/markets?limit=5&status=open" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### 3. 手动或使用交易所原生工具比较

使用 Polymarket `slug`/`question` 与 Kalshi `ticker`/`event_ticker`/`title` 等共享字段配对可能等价的市场，然后在执行前用对应交易所官方 API 验证实时价格和订单簿。

## 端点参考

| Endpoint | 方法 | 用途 |
| - | - | - |
| `/polymarket/markets` | GET | [Polymarket 市场](https://aisa.one/docs/api-reference/prediction-market/get_polymarket-markets.md) |
| `/polymarket/events` | GET | [Polymarket 事件](https://aisa.one/docs/api-reference/prediction-market/get_polymarket-events.md) |
| `/polymarket/activity` | GET | [Polymarket 活动记录](https://aisa.one/docs/api-reference/prediction-market/get_polymarket-activity.md) |
| `/kalshi/markets` | GET | [Kalshi 市场](https://aisa.one/docs/api-reference/prediction-market/get_kalshi-markets.md) |
| `/kalshi/trades` | GET | [Kalshi 交易记录](https://aisa.one/docs/api-reference/prediction-market/get_kalshi-trades.md) |

## 开始使用

1. 在 [aisa.one](https://aisa.one) 注册（新账户有 \$1 免费额度）。
2. 从控制台生成 API key。
3. 设置 key 并安装技能：
   ```bash theme={null}
   export AISA_API_KEY="your-key"
   npm install -g @aisa-one/cli
   aisa skills install prediction-market-arbitrage
   ```

## 相关

> [card] [预测市场 API](https://aisa.one/docs/api-reference/prediction-market/get_polymarket-markets.md)
>
> 已挂载的 Polymarket 和 Kalshi 发现端点。

> [card] [市场数据技能](https://aisa.one/docs/zh/agent-skills/prediction-market-data.md)
>
> 该技能构建于其上的底层数据技能。

> [card] [速率限制](https://aisa.one/docs/api-reference/rate-limits.md)
>
> 运行研究扫描时的并发限制。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.