> Documentation index: https://pmdata.dev/llms.txt. Full docs in one file: https://pmdata.dev/llms-full.txt

# Lifecycle

Source: https://pmdata.dev/docs/schemas/predict-fun/lifecycle

> Schema for Predict.fun market lifecycle updates.

**All fields come from the raw Predict.fun WebSocket message.** PMData adds only the receive timestamp `local_timestamp`.

**Data type:** `lifecycle` (`predict_fun`)

Source topics: `predictMarketStatus/{marketId}`, `predictTradingStatus/{marketId}` and `predictMarketChanged/{marketId}`. One file per UTC day of `local_timestamp` holds every market.

| Field | Type | Description |
| --- | --- | --- |
| `market_id` | `int64` | Predict.fun numeric market id. Source: `data.marketId`. |
| `timestamp` | `timestamp[us] \| null` | Time the state took effect. Source: `data.tsMs`. |
| `local_timestamp` | `timestamp[us]` | PMData receive timestamp. When the same row arrives more than once, the earliest receive time. |
| `event_type` | `string` | Topic name: `predictMarketStatus`, `predictTradingStatus` or `predictMarketChanged`. |
| `status` | `string \| null` | `predictMarketStatus` only. Market status as sent, for example `REGISTERED`, `PRICE_PROPOSED`, `PRICE_DISPUTED`, `RESOLVED` or `REMOVED`. Source: `data.status`. |
| `trading_status` | `string \| null` | `predictTradingStatus` only. Trading status as sent, for example `OPEN`, `MATCHING_NOT_ENABLED` or `CLOSED`. Source: `data.tradingStatus`. |
| `outcome_labels` | `list<string> \| null` | Outcome labels, on `RESOLVED` messages. The first label is the outcome the [L2](https://pmdata.dev/docs/schemas/predict-fun/l2) book is priced in. Source: `data.marketOutcomes[].label`. |
| `outcome_prices` | `list<double> \| null` | Settlement price of each outcome, in the order of `outcome_labels`. A market can settle 0.5 / 0.5. Source: `data.marketOutcomes[].price`. |
| `patch_kind` | `string \| null` | `predictMarketChanged` only, for example `cryptoUpDownVariantData` or `translationUpdate`. Source: `data.patchKind`. |
| `patch_json` | `string \| null` | `predictMarketChanged` only. The change as compact JSON; the opening and closing prices of crypto Up/Down markets are here. Source: `data.patch`. |

- Each day has, for every market and topic, the first state seen that day, plus every change during the day. Identical rows within a day are kept once.
- Predict.fun sends the current state on every subscription, and PMData's connections re-subscribe every hour. A `timestamp` earlier than the file's day is a state carried over, not a change.
- Rows are ordered by `timestamp`, then `local_timestamp`, then `market_id`.

## Timestamps

All timestamps are UTC with microsecond precision. Predict.fun sends epoch milliseconds.
