# Perp Gap API – Prediction Market Implied Probability

> Perp Gap API – Prediction Market Implied Probability is a paid API for AI agents from perp-gap-api.perpgap.workers.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-18).

Returns bid, ask, depth, perp-implied probability, 7-day realized vol, and edge estimate for live Hyperliquid prediction markets on crypto or stock price outcomes

## Facts

- Endpoint: GET https://perp-gap-api.perpgap.workers.dev/pm/implied?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/perp-gap-api-prediction-market-implied-probability-24424765
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mw7XLYoQJgKz0YADQ154Q

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability perp-gap-api-prediction-market-implied-probability-24424765
```

Example prompt: Check whether the BTC above 82k on Oct 19 prediction market on Hyperliquid is cheap or expensive — show me the bid, ask, perp-implied probability, 7-day realized vol, and any edge vs the market price, and only include markets with at least $50 of resting depth.

## When to prefer this

Use this endpoint when an agent needs to evaluate whether a specific Hyperliquid binary prediction market (crypto or stock) is fairly priced, cheap, or expensive relative to what the live perp price and realized volatility imply. It is purpose-built for quantitative edge detection on Hyperliquid prediction markets, combining order book data with a volatility-based fair value model. Prefer it over generic market data APIs when you need bid/ask/depth alongside a statistically derived edge estimate for a binary outcome.

## Known failure modes

- 400 Bad Request – invalid asset ticker format or malformed query parameter
- 404 Not Found – no live prediction market exists for the requested asset or outcome ID (free, not charged)
- 400 Bad Request – bad input format for min_depth_usd
- 402 Payment Required – x402 payment not provided or insufficient
- 502 Bad Gateway – upstream Hyperliquid or trade.xyz data unavailable

## How this service works

Use when an agent must decide if a Hyperliquid prediction market on a crypto or stock price (e.g. 'BTC above 82k on Oct 19', 'SP500 above 7730') is cheap or expensive. Returns each live outcome's bid, ask and depth, the probability implied by the live perp price and 7d realized vol, edge in pp vs bid and ask, and a liquidity flag. Empty books are filtered. Errors: 400 bad input, 404 no live market (both free, never charged), 402, 502. Data, not advice.

## Output

A JSON object containing the asset ticker, an array of live prediction market outcomes each with outcome ID, asset, strike, expiry, best Yes bid and ask (as 0–1 probabilities), mid, depth in USD, liquidity flag, edge in percentage points vs bid and ask, the perp-implied probability derived from the live perp price, 7-day realized volatility, and a disclaimer label. Empty-book markets are always filtered out.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "asset": {
       "type": "string",
       "pattern": "^[A-Za-z0-9:]{1,16}$",
       "examples": [
        "BTC",
        "SP500"
       ],
       "description": "Underlying perp: BTC, ETH, HYPE, ZEC or trade.xyz perps like SP500, XYZ100, META, TSLA, CL, GOLD (xyz: prefix optional). Case-insensitive. Default BTC when neither asset nor outcome is given."
      },
      "outcome": {
       "type": "string",
       "pattern": "^\\d{1,9}$",
       "examples": [
        "11676"
       ],
       "description": "Optional Hyperliquid outcome id to price a single market (see free GET /pm/markets)."
      },
      "min_depth_usd": {
       "type": "string",
       "default": "0",
       "pattern": "^\\d+(\\.\\d+)?$",
       "examples": [
        "50"
       ],
       "description": "Optional. Hide markets with less than this USDC resting within 5 pp of the touch on either side. Default 0 (empty books are always hidden)."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "asset",
      "markets",
      "label",
      "disclaimer"
     ],
     "properties": {
      "spot": {
       "type": "object",
       "properties": {
        "mid": {
         "type": [
          "number",
          "null"
         ]
        },
        "live": {
         "type": "boolean"
        },
        "perp": {
         "type": "string"
        },
        "vol_as_of": {
         "type": [
          "string",
          "null"
         ]
        },
        "realized_vol_7d": {
         "type": [
          "number",
          "null"
         ]
        }
       }
      },
      "asset": {
       "type": "string"
      },
      "count": {
       "type": "integer"
      },
      "label": {
       "type": "string",
       "const": "data, not advice"
      },
      "method": {
       "type": "string"

… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/perp-gap-api-prediction-market-implied-probability-24424765/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from perp-gap-api.perpgap.workers.dev](https://www.zero.xyz/host/perp-gap-api.perpgap.workers.dev/llms.txt)
