> ## 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.

# Prediction Market Arbitrage

> Cross-platform prediction-market research using the currently mounted Polymarket and Kalshi discovery endpoints.

[View on GitHub →](https://github.com/AIsa-team/agent-skills/tree/main/prediction-market-arbitrage)

**Research prediction-market opportunities with AIsa.** One `AISA_API_KEY` can pull mounted Polymarket and Kalshi market-discovery data so agents can identify candidate events before using venue-specific tooling for pricing, orderbook depth, or execution.

## Install

First, install the AIsa CLI if you have not already:

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

Then install the skill:

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

## What can agents do with it?

<CardGroup cols={2}>
  <Card title="Cross-market discovery" icon="magnifying-glass-plus">
    "Find related NFL, macro, or election markets on Polymarket and Kalshi."
  </Card>

  <Card title="Candidate pairing" icon="arrows-left-right">
    "Compare titles, event tickers, slugs, and close times to identify likely equivalent markets."
  </Card>

  <Card title="Liquidity triage" icon="droplet">
    "Use volume and liquidity fields from discovery responses to prioritize venues for deeper checks."
  </Card>

  <Card title="Sports research workflow" icon="football">
    "Build a same-day candidate list from available Polymarket and Kalshi market feeds."
  </Card>

  <Card title="Elections & macro" icon="landmark">
    "Surface comparable event markets before running venue-specific pricing checks."
  </Card>

  <Card title="Execution prep" icon="bullseye">
    "Produce a research shortlist; perform execution and orderbook checks directly with each venue."
  </Card>
</CardGroup>

## How it works

<Steps>
  <Step title="Discover candidate markets">
    Query `/polymarket/markets`, `/polymarket/events`, and `/kalshi/markets` to find relevant market/event records.
  </Step>

  <Step title="Pair likely equivalents">
    Match candidates by title, event ticker, slug, event date, sport/team names, or market close time.
  </Step>

  <Step title="Validate pricing outside this AIsa surface">
    Use venue-native APIs or trading systems for current price, orderbook depth, and execution checks before trading.
  </Step>
</Steps>

<Warning>
  AIsa currently mounts the Prediction Market discovery endpoints listed below. Older examples for AIsa-hosted `market-price`, `orderbooks`, and `matching-markets` routes were removed because authenticated probes returned `api endpoint not found`.
</Warning>

## Quick start

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

### 1. Find Polymarket candidates

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

### 2. Find Kalshi candidates

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

### 3. Compare manually or with venue-native tooling

Use shared fields such as Polymarket `slug`/`question` and Kalshi `ticker`/`event_ticker`/`title` to pair likely equivalents, then verify live prices and orderbooks with the relevant venue's official API before execution.

## Endpoint reference

| Endpoint               | Method | Purpose                                                                         |
| ---------------------- | ------ | ------------------------------------------------------------------------------- |
| `/polymarket/markets`  | GET    | [Polymarket markets](/api-reference/prediction-market/get_polymarket-markets)   |
| `/polymarket/events`   | GET    | [Polymarket events](/api-reference/prediction-market/get_polymarket-events)     |
| `/polymarket/activity` | GET    | [Polymarket activity](/api-reference/prediction-market/get_polymarket-activity) |
| `/kalshi/markets`      | GET    | [Kalshi markets](/api-reference/prediction-market/get_kalshi-markets)           |
| `/kalshi/trades`       | GET    | [Kalshi trades](/api-reference/prediction-market/get_kalshi-trades)             |

## Get started

1. Sign up at [aisa.one](https://aisa.one) (new accounts start with \$2 free credit).
2. Generate an API key from the console.
3. `export AISA_API_KEY="your-key"` and install the skill:
   ```bash theme={null}
   npm install -g @aisa-one/cli
   aisa skills install prediction-market-arbitrage
   ```

## Related

<CardGroup cols={3}>
  <Card title="Prediction Market API" icon="chart-simple" href="/api-reference/prediction-market/get_polymarket-markets">
    Mounted Polymarket and Kalshi discovery endpoints.
  </Card>

  <Card title="Market Data skill" icon="chart-line" href="/agent-skills/prediction-market-data">
    The underlying data skill this one builds on.
  </Card>

  <Card title="Rate Limits" icon="gauge-high" href="/api-reference/rate-limits">
    Concurrency caps when running research scans.
  </Card>
</CardGroup>
