# Market Data

Prediction Markets market data is organized around events and their contracts. Use the public REST API to discover the markets that are currently available and to resolve each contract to its `instrumentSymbol`. Use REST for discovery and snapshots, then use WebSocket streams for low-latency updates.

## Market-data workflow

1. [List active events](#list-active-events) and choose an event.
2. [Get the event details](#get-event-details) using the event `ticker`.
3. [Identify a contract](#identify-a-contract) and save its `instrumentSymbol`.
4. [Read the event snapshot](#read-the-event-snapshot) for the contract’s current pricing and order-book fields.
5. [Subscribe to WebSocket streams](#subscribe-to-websocket-streams) for continuing updates.

## List active events

Use [List Events](/rest-api/prediction-markets/events/list-events) with `status=active` to discover events that are currently active. The response is paginated; use `limit` and `offset` to retrieve additional results. You can also filter by `category` or search the event title with `search`.

```bash
curl "https://api.gemini.com/v1/prediction-markets/events?status=active&limit=50"
```

Each event includes an event `ticker`, such as `FEDJAN26`, along with its title, status, expiry, and contracts. Keep the event ticker for the next request. Do not construct a contract symbol from the title or slug: use the `instrumentSymbol` returned for the contract.

## Get event details

Call [Get Event](/rest-api/prediction-markets/events/get-event) with the event ticker:

```bash
curl "https://api.gemini.com/v1/prediction-markets/events/FEDJAN26"
```

The event response provides the authoritative event definition and its `contracts` array. It can also include contract pricing and `contractOrderbooks`. Treat the event and contract `status` values as metadata, and verify that the contract is still available before using it for a live subscription.

For crypto Up/Down events, the [Get Strike Price for Event](/rest-api/prediction-markets/events/get-event-strike) endpoint provides strike information when it becomes available.

## Identify a contract

Select a contract from the event’s `contracts` array. The fields most useful for market-data clients are:

| Field | Use |
| --- | --- |
| `ticker` | Contract-level identifier returned by the event API. |
| `label` | Human-readable outcome, such as `Yes` or `No`. |
| `status` | Contract lifecycle status. |
| `marketState` | Whether the contract is currently open or closed for trading. |
| `instrumentSymbol` | Symbol required by the REST market-data routes and WebSocket stream names. |
| `prices` | Current contract pricing, including `bestBid`, `bestAsk`, and `lastTradePrice` when available. |

For example, a contract may return:

```json
{
  "ticker": "FEDJAN26-DN25",
  "label": "Fed cuts at least 25 bps",
  "status": "active",
  "marketState": "open",
  "instrumentSymbol": "GEMI-FEDJAN26-DN25"
}
```

Use the exact `instrumentSymbol` value, including capitalization and punctuation, in subsequent requests. The instrument identifies the contract's proposition in YES space. Orders select the `yes` or `no` outcome separately; do not append an outcome to the symbol unless Gemini returned it as part of the symbol.

## Read the event snapshot

The Prediction Markets event response is the REST discovery snapshot. Its contract records can include current `prices` and `contractOrderbooks` fields, alongside the contract status and `instrumentSymbol`. Use those fields for discovery and initial display, then use the Prediction Markets WebSocket streams for live book and trade updates.

Prices and quantities are returned as strings. Preserve that precision instead of converting values to binary floating-point numbers. After a disconnect or a missed update, request the event again and resubscribe before resuming local state.

## Subscribe to WebSocket streams

Connect to `wss://ws.gemini.com` and subscribe using the contract’s `instrumentSymbol`. The [Prediction Markets WebSocket introduction](/prediction-markets/websocket/introduction) documents the connection, and the [Stream Reference](/prediction-markets/websocket/streams) documents payloads and stream names.

Choose a stream based on the data you need:

| Stream | Use |
| --- | --- |
| `{instrumentSymbol}@bookTicker` | Real-time best bid and ask. |
| `{instrumentSymbol}@depth5`, `@depth10`, or `@depth20` | Periodic top-of-book snapshots. |
| `{instrumentSymbol}@depth` or `@depth@100ms` | Differential depth updates for maintaining a local order book. |
| `{instrumentSymbol}@trade` | Real-time executions. |

For a differential depth stream, connect with `snapshot=-1` to receive a full initial order-book snapshot, then apply subsequent updates. Public depth is normalized in YES space; derive NO notional with `1 - yesPrice`. If update IDs skip ahead, discard the local book and resubscribe to resynchronize. The stream reference also explains how zero quantities remove price levels.

WebSocket subscriptions use the symbol returned by the event API. For example, a subscription name for the contract above is:

```text
GEMI-FEDJAN26-DN25@bookTicker
```

Use WebSocket as the primary source for active monitoring and trading workflows. Keep the REST event and market-data endpoints available for discovery, initialization, reconnect recovery, and audit snapshots.
