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

# Market Lifecycle

> Subscribe to market creation and resolution events and read the marketCreated and marketResolved payloads

This page covers subscribing to market creation and resolution events with `subscribe_market_lifecycle`, and the `marketCreated` and `marketResolved` payloads that subscription delivers.

## Subscribing to market lifecycle events

Subscribe to market creation and resolution events by emitting `subscribe_market_lifecycle`. No authentication required.

```typescript theme={null}
socket.on('connect', () => {
  socket.emit('subscribe_market_lifecycle');
});

socket.on('marketCreated', (data) => {
  console.log('New market:', data.slug, data.title);
});

socket.on('marketResolved', (data) => {
  console.log('Market resolved:', data.slug, data.winningOutcome);
});
```

<Note>
  `marketResolved` is also emitted to existing per-market room subscribers automatically (CLOB: `market:{slug}`, AMM: `market:{address}`). You don't need a separate lifecycle subscription to receive resolution events for markets you're already watching.
</Note>

To unsubscribe:

```typescript theme={null}
socket.emit('unsubscribe_market_lifecycle');
```

## Event payloads

### `marketCreated`

Emitted when a new market is funded and visible. Hidden markets are excluded.

```json theme={null}
{
  "slug": "btc-above-110k-apr-2026",
  "title": "$BTC above $110,000 on Apr 5, 2026?",
  "type": "CLOB",
  "groupSlug": "btc-price-markets",
  "categoryIds": [1, 5],
  "createdAt": "2026-04-02T12:00:00.000Z"
}
```

| Field         | Type              | Description                                |
| ------------- | ----------------- | ------------------------------------------ |
| `slug`        | `string`          | Market slug identifier                     |
| `title`       | `string`          | Market title                               |
| `type`        | `'AMM' \| 'CLOB'` | Market type                                |
| `groupSlug`   | `string?`         | Parent group slug (for NegRisk submarkets) |
| `categoryIds` | `number[]?`       | Category IDs the market belongs to         |
| `createdAt`   | `string`          | ISO-8601 creation timestamp                |

### `marketResolved`

Emitted when a market resolves. Sent to both `market_lifecycle` subscribers and existing `market:{slug}` room subscribers.

```json theme={null}
{
  "slug": "btc-above-110k-apr-2026",
  "type": "CLOB",
  "winningOutcome": "YES",
  "winningIndex": 0,
  "resolutionDate": "2026-04-05T14:00:00.000Z"
}
```

| Field            | Type              | Description                                    |
| ---------------- | ----------------- | ---------------------------------------------- |
| `slug`           | `string`          | Market slug identifier                         |
| `type`           | `'AMM' \| 'CLOB'` | Market type                                    |
| `winningOutcome` | `'YES' \| 'NO'`   | The winning outcome                            |
| `winningIndex`   | `0 \| 1`          | Index of the winning outcome (0 = YES, 1 = NO) |
| `resolutionDate` | `string`          | ISO-8601 resolution timestamp                  |

## Related

* [WebSocket overview](/developers/websocket/overview): connection details, handshake authentication, and the full event reference
