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

# Market Detail

> Full profile for one Kalshi or Polymarket ticker — price, orderbook, indicators, regime, cross-venue counterpart, edges, and 7-day history.

The market-detail endpoint returns one market's complete profile in a single round-trip: live price, top of book and optional 5-level depth, SimpleFunctions indicators, regime label, cross-venue counterpart, attached thesis edges, follow-up `nextActions`, and canonical URLs. A sibling endpoint returns a 7-day rolling history of that market's indicators and regime snapshots.

## Endpoints

```http theme={null}
GET /api/public/market/{ticker}
GET /api/public/market/{ticker}/history
```

Auth: **none.** Both endpoints are public, cached at the edge.

## Identifiers

| Format                 | Example                         | Notes                                           |
| ---------------------- | ------------------------------- | ----------------------------------------------- |
| Kalshi raw ticker      | `KXFEDDECISION-26DEC10-T0`      | Uppercase + hyphens.                            |
| Polymarket conditionId | `0x5db999fad322cea2918a3681...` | 66-char hex.                                    |
| Polymarket numeric id  | `12345`                         | Decimal id. Accepted but conditionId preferred. |

UUIDs from the deprecated `external_markets` table return `410 Gone` so search engines de-index those URLs faster than they would for a `404`.

## Detail

```http theme={null}
GET /api/public/market/{ticker}
```

<CodeGroup>
  ```bash curl theme={null}
  curl "https://simplefunctions.dev/api/public/market/KXFEDDECISION-26DEC10-T0"
  ```

  ```bash CLI theme={null}
  sf inspect KXFEDDECISION-26DEC10-T0 --json
  ```

  ```ts TypeScript theme={null}
  const res = await fetch(
    `https://simplefunctions.dev/api/public/market/${ticker}?depth=true`
  )
  const market = await res.json()
  ```
</CodeGroup>

### Query parameters

| Param            | Type    | Default  | Notes                                                                                                              |
| ---------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| `depth`          | boolean | `false`  | When `true`, include 5-level orderbook depth (`bidLevels`, `askLevels`).                                           |
| `refresh`        | boolean | `false`  | Force a fresh regime computation (\~LLM cost). **Requires `Authorization: Bearer sf_live_xxx`** — otherwise `401`. |
| `cv_preset`      | string  | `detail` | Cross-venue match preset. Other presets exist; `detail` is the default.                                            |
| `cv_min_conf`    | number  | `0.60`   | Min cross-venue match confidence (0–1).                                                                            |
| `cv_max_dt_days` | number  | —        | Max close-time delta (days) for cross-venue match.                                                                 |
| `nextActions`    | `off`   | —        | When `off`, omit the `nextActions` block.                                                                          |

The endpoint streams a single response — there is no pagination. Cache: `Cache-Control: public, s-maxage=60, stale-while-revalidate=120`.

### Response shape

<Expandable title="Full response">
  ```json theme={null}
  {
    "ticker": "KXFEDDECISION-26DEC10-T0",
    "venue": "kalshi",
    "title": "Will the Fed cut rates at the December meeting?",
    "description": "Resolves YES if the FOMC announces a rate cut at the December 10, 2026 meeting.",
    "price": 0.42,
    "bestBid": 0.41,
    "bestAsk": 0.43,
    "spread": 0.02,
    "volume": 124500,
    "volume24h": 8200,
    "openInterest": 45000,
    "status": "active",
    "closeTime": "2026-12-10T19:00:00.000Z",
    "category": "financial",
    "liquidityScore": "high",
    "slug": "will-the-fed-cut-rates-at-the-december-meeting",
    "bidLevels": [{ "price": 0.41, "size": 1200 }],
    "askLevels": [{ "price": 0.43, "size": 700 }],
    "edges": [
      {
        "thesisTitle": "Fed will cut by Dec",
        "thesisSlug": "fed-will-cut-by-dec",
        "thesisPrice": 0.55,
        "edge": 13,
        "direction": "buy_yes",
        "firstDetectedAt": "2026-04-23T14:00:00.000Z",
        "firstDetectedPrice": 0.39
      }
    ],
    "indicators": {
      "tauDays": 219,
      "iyYes": 320,
      "iyNo": null,
      "cri": 1.18,
      "ee": 13,
      "eeSource": "thesis",
      "las": 0.05,
      "cvr": 1.02,
      "overround": 0.03,
      "rv": null,
      "vr": null,
      "iar": null,
      "adjIy": 280,
      "daysToEvent": 219,
      "expectedVr": null,
      "residualVr": null,
      "hasThesis": true,
      "hasOrderbook": true,
      "lastComputedAt": "2026-05-05T17:45:00.000Z"
    },
    "crossVenue": {
      "ticker": "0x5db999fad322cea2918a3681...",
      "venue": "polymarket",
      "title": "Fed cuts rates at December 2026 meeting?",
      "confidenceScore": 0.86,
      "closeTimeDeltaSec": 0,
      "matchMethod": "title_similarity",
      "isArbReady": true,
      "priceCents": 44,
      "indicators": {
        "ee": 11,
        "las": 0.04,
        "cvr": 1.02,
        "tauDays": 219,
        "iyYes": 305,
        "iyNo": null
      }
    },
    "regime": {
      "score": 0.21,
      "label": "maker",
      "signals": {
        "spreadPct": 0.046,
        "depthChange1h": null,
        "volumeZscore": -0.3,
        "flowImbalance": 0.05,
        "crossVenueGap": -0.02,
        "catalystType": null,
        "catalystHours": null,
        "sfEdgeCents": 13,
        "sfEdgeDirection": "buy_yes",
        "observability": "high",
        "eventType": "data_release",
        "asPrior": 0.18
      },
      "computedAt": "2026-05-05T17:48:12.000Z",
      "fresh": false
    },
    "pageUrl": "https://simplefunctions.dev/markets/will-the-fed-cut-rates-at-the-december-meeting",
    "apiUrl": "https://simplefunctions.dev/api/public/market/KXFEDDECISION-26DEC10-T0",
    "inspectUrl": "https://simplefunctions.dev/api/agent/inspect/KXFEDDECISION-26DEC10-T0",
    "fetchedAt": "2026-05-05T18:00:00.000Z",
    "nextActions": {
      "inspect": [
        { "description": "Full dossier for ...", "method": "GET", "url": "https://simplefunctions.dev/api/agent/inspect/..." }
      ],
      "related": [
        { "description": "Contagion — lagging siblings", "method": "GET", "url": "https://simplefunctions.dev/api/public/contagion?window=6h" },
        { "description": "Top edges across theses", "method": "GET", "url": "https://simplefunctions.dev/api/edges" },
        { "description": "Salience snapshot", "method": "GET", "url": "https://simplefunctions.dev/api/agent/world" }
      ]
    }
  }
  ```
</Expandable>

### Field reference

| Field                                     | Type                        | Notes                                                                                                        |
| ----------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `ticker`, `venue`, `title`, `description` | string                      | Identity. `description` may be empty.                                                                        |
| `price`                                   | number                      | Current YES probability `[0, 1]`.                                                                            |
| `bestBid`, `bestAsk`, `spread`            | number                      | Top of book and `bestAsk - bestBid`.                                                                         |
| `volume`, `volume24h`, `openInterest`     | number                      | Traded volume / open interest. `volume24h` is enriched from `marketIndicators` when the venue API returns 0. |
| `status`                                  | string                      | `active`, `closed`, `settled`.                                                                               |
| `closeTime`                               | ISO 8601                    | When the market closes.                                                                                      |
| `category`                                | string                      | Kalshi-supplied category. Polymarket markets do not carry one.                                               |
| `liquidityScore`                          | `high` \| `medium` \| `low` | Coarse bucket from spread + depth.                                                                           |
| `slug`                                    | string                      | Canonical SEO slug used by `/markets/{slug}`.                                                                |
| `bidLevels`, `askLevels`                  | `Array<{price, size}>`      | 5 levels each, only present with `depth=true`.                                                               |
| `edges[]`                                 | array                       | Thesis-derived mispricings touching this ticker — see `/api-reference/thesis`.                               |
| `indicators`                              | object \| null              | Bundle of computed indicators (see below). `null` if the ticker isn't yet in the cached set.                 |
| `crossVenue`                              | object \| null              | Counterpart on the other venue when SimpleFunctions has matched a pair. `null` otherwise.                    |
| `regime`                                  | object \| null              | Adverse-selection score + label + raw signals. May be re-computed when stale.                                |
| `pageUrl`, `apiUrl`, `inspectUrl`         | string                      | Canonical absolute URLs for the same market.                                                                 |
| `fetchedAt`                               | ISO 8601                    | When this response was assembled.                                                                            |
| `nextActions`                             | object                      | Pre-built follow-up URLs (`inspect`, `related`). Omit with `nextActions=off`.                                |

### Indicators bundle

Returned in `indicators` when the ticker is in `marketIndicators`. All numeric fields are nullable.

| Field                                     | Meaning                                                                                               |    |                                                           |
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------- | -- | --------------------------------------------------------- |
| `tauDays`                                 | Days to expiry.                                                                                       |    |                                                           |
| `iyYes`, `iyNo`                           | Implied annualized yield (%) for each side. Suppressed (set to `null`) when `tauDays < 1` or \`       | IY | > 1000%\` to prevent display blow-up on intraday markets. |
| `cri`                                     | Cliff risk = `max(p, 1-p) / min(p, 1-p)`.                                                             |    |                                                           |
| `ee`                                      | Expected edge in cents. `eeSource` documents the origin (`thesis` or `regime`).                       |    |                                                           |
| `las`                                     | Liquidity-adjusted spread = `spread / mid`.                                                           |    |                                                           |
| `cvr`                                     | Cross-venue ratio.                                                                                    |    |                                                           |
| `overround`                               | Event overround when this ticker is part of a multi-leg event.                                        |    |                                                           |
| `rv`, `vr`, `iar`                         | Realized variance, variance ratio, implied/actual ratio (where available).                            |    |                                                           |
| `adjIy`                                   | IY adjusted for liquidity and overround.                                                              |    |                                                           |
| `daysToEvent`, `expectedVr`, `residualVr` | Catalyst proximity and variance fit.                                                                  |    |                                                           |
| `hasThesis`, `hasOrderbook`               | Booleans — whether SimpleFunctions currently has a thesis edge or a cached orderbook for this ticker. |    |                                                           |
| `lastComputedAt`                          | When the bundle was last refreshed.                                                                   |    |                                                           |

### Regime block

The `regime` block reports SimpleFunctions's adverse-selection scoring (0–1) plus the label `maker`, `taker`, or `neutral`. The cached snapshot is served when fresh (≤15 min old). When stale or when the live spread differs from the cached spread by >50%, the server re-computes on demand and returns `fresh: true`. With `?refresh=true` (auth required), the server always re-computes.

### Errors

| Status | Body                                                        | Cause                                                   |
| ------ | ----------------------------------------------------------- | ------------------------------------------------------- |
| `400`  | `{ error: "Invalid ticker" }`                               | Empty or under 3 chars.                                 |
| `401`  | `{ error: "refresh=true requires API key" }`                | `?refresh=true` without a Bearer key.                   |
| `404`  | `{ error: "Market not found" }`                             | Venue API returned 404/422.                             |
| `410`  | `{ error: "This market ID format is no longer supported" }` | Legacy UUID — cached for 24h to accelerate de-indexing. |
| `500`  | `{ error: "Failed to fetch market", detail: "..." }`        | Upstream venue error.                                   |

## History

```http theme={null}
GET /api/public/market/{ticker}/history
```

7-day rolling window of two parallel time-series for the ticker:

```bash theme={null}
curl "https://simplefunctions.dev/api/public/market/KXFEDDECISION-26DEC10-T0/history"
```

<Expandable title="Response shape">
  ```json theme={null}
  {
    "ticker": "KXFEDDECISION-26DEC10-T0",
    "windowDays": 7,
    "indicatorHistory": [
      { "at": "2026-04-29T00:00:00.000Z", "price": 39, "delta": 0, "iy": 312.4, "cri": 1.21 },
      { "at": "2026-04-29T01:00:00.000Z", "price": 40, "delta": 1, "iy": 309.7, "cri": 1.20 }
    ],
    "regimeHistory": [
      { "at": "2026-04-29T00:00:00.000Z", "score": 0.22, "label": "maker", "spreadCents": 2, "bidDepthUsd": 12000, "askDepthUsd": 7000, "volume24h": 4200 }
    ],
    "indicatorCount": 168,
    "regimeCount": 28
  }
  ```
</Expandable>

| Field                           | Notes                                                                             |
| ------------------------------- | --------------------------------------------------------------------------------- |
| `windowDays`                    | Always 7 (server-side).                                                           |
| `indicatorHistory[]`            | From `marketIndicatorHistory`, oldest → newest. Up to 2,000 rows.                 |
| `regimeHistory[]`               | From `marketRegimeSnapshots`, oldest → newest. Up to 500 rows.                    |
| `indicatorCount`, `regimeCount` | How many rows the underlying tables actually hold for this ticker (after limits). |

Both arrays are **empty for tickers outside the warm-regime cron's top-500 coverage**. Frontends should handle the empty state — most non-top tickers return `indicatorHistory: []` and a populated `regimeHistory`, or vice versa, depending on which cron has touched them.

Cache: `Cache-Control: s-maxage=600, stale-while-revalidate=1200`. Errors return `400 ticker required` or `500 history failed`.

## CLI equivalents

```bash theme={null}
sf inspect <ticker> --json
sf inspect <ticker> --depth --json
sf book <ticker> --json
```

`sf inspect` calls `/api/agent/inspect/{ticker}` for an agent-shaped dossier; `sf book` hits `/api/public/market/{ticker}?depth=true` directly.

## See also

<CardGroup cols={2}>
  <Card title="Indicators" href="/concepts/indicators">
    What `iy`, `cri`, `ee`, `las`, `cvr`, `tauDays` mean.
  </Card>

  <Card title="Market regime" href="/concepts/regime">
    Adverse-selection score, label, signal interpretation.
  </Card>

  <Card title="Inspect ticker" href="/api-reference/agent#inspect-ticker">
    Agent-shaped variant: `/api/agent/inspect/{ticker}`.
  </Card>

  <Card title="Real-time data" href="/reference/realtime-data">
    Streaming orderbook / candles / trades for the same ticker over WS.
  </Card>
</CardGroup>
