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

# Message Patterns

All MLink messages are generated from a common IDL schema and follow common patterns, including the following:

### Live Data Objects with Primary Key

These messages have a well-defined primary key (unique per message type) and follow a create/replace pattern such that any new message arriving in MLink will completely replace the previous record with the same primary key, if one exists.

**Example:** "NBBOOptionQuote" message

### Security Keys

Several messages contain security keys (TickerKey, ExpiryKey, and/or OptionKey).

* **TickerKey:** `SSSS-TS-AT` where SSSS is the security symbol (eg. AAPL), TS is a ticker source (eg. NMS), and AT is an asset type (eg. EQT).
* **ExpiryKey:** `SSSS-TS-AT-YYYY-MM-DD` where YYYY is year, MM is month, and DD is day.
* **OptionKey:** `SSSS-TS-AT-YYYY-MM-DD-XXXX-CP` where XXXX is the strike price, and CP is either (Call, Put, or Both).

*Ticker Sources (ts) and Asset Types (at) are enumerated.*

### Special Data Objects

* **Spreads:** `#SSSShhhh` where hhhh is a hexadecimal ID number.
* **FLEX:** encoded as OptionKeys with the security symbol being the standard FLEX root.
* **Market Data:** distributed with one of the above security keys where the symbol is the exchange trading symbol.
* **Synthetics:** `_SSSS` or `SSSS_` computed for the purpose of pricing options more accurately.

### Admin Data Objects without Primary Keys

Some SR MLink objects do not have natural primary keys and are used as administrative messages between MLink and a client.

### HTTP/REST Admin Messages

| Messages          | Description                                                   |
| ----------------- | ------------------------------------------------------------- |
| `MLinkApiKey `    | Used to return a temporary ApiKey                             |
| `QueryResult   `  | Futures quote/print metrics                                   |
| `MsgDesc   `      | Message Description                                           |
| `FieldDesc      ` | Field Description (schema)                                    |
| `SummaryNumeric ` | Summary detail for a numeric field                            |
| `SummaryString `  | Summary detail for a string field                             |
| `PostAck`         | Post acknowledgment for an individual SR message post attempt |

### MLink/WebSocket Admin Messages

| Messages                | Description                                                           |
| ----------------------- | --------------------------------------------------------------------- |
| `MLinkAdmin  `          | Sent in response to a WebSocket connect attempt or MLinkLogon message |
| `MLinkLogon   `         | Used to logon (authenticate)                                          |
| `MLinkStream   `        | Set or update the active subscription query for this session          |
| `MLinkStreamAck `       | Sent in response to an MLinkStream attempt                            |
| `MLinkStreamCheckPt`    | Query Check Point                                                     |
| `MLinkSignalReady `     | Used to signal that the client is ready for more messages             |
| `MLinkDataAck     `     | Sent in response to a message upload attempt                          |
| `MLinkSubscribe    `    | Set or update an active subscription for a session by msgPKey         |
| `MLinkSubscribeAck`     | Sent in response to an MLinkSubscribe attempt                         |
| `MLinkSubscribeCheckPt` | Subscription Check Point                                              |
| `MLinkHeartbeat  `      | MLink Connection heartbeat; sent by default every 10 seconds          |
