> For the complete documentation index, see [llms.txt](https://blockhouse-app.gitbook.io/blockhouse/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blockhouse-app.gitbook.io/blockhouse/asset-classes/equities/data-schemas-and-execution-formats.md).

# Data Schemas & Execution Formats

## Equities Market Data Schema

### **Supported Asset**

#### **1. Equities (General Category for Stock Market Products)**

Equities market data covers different stock exchanges and venues, including:

* **U.S. Stocks:** NYSE, NASDAQ, AMEX

#### **2. Market Data**

This dataset contains two primary types of market data:

* **MBO (Market By Order):** Provides detailed order-level information, tracking each individual order's lifecycle.
* **MBP1 (Market By Price 1):** Represents the best bid and ask prices along with their respective quantities at a given moment.

### **Data Schema**

#### **Market by Order (MBO)**

**Description**

Market by Order (MBO) provides every order book event at all price levels, allowing users to track order queue position and market depth at the highest level of granularity.

MBO data includes:

* Order adds, cancels, and modifications
* Trade executions
* Book clear events
* Special order events

This is commonly referred to as **Level 3 (L3) data**.

**Fields (`mbo`)**

| **Field**       | **Type**  | **Description**                                                                                         |
| --------------- | --------- | ------------------------------------------------------------------------------------------------------- |
| `publisher_id`  | uint16\_t | Publisher ID assigned by Databento, denoting dataset and venue.                                         |
| `instrument_id` | uint32\_t | Numeric instrument ID.                                                                                  |
| `ts_event`      | uint64\_t | Timestamp when the event was received by the matching engine (nanoseconds since UNIX epoch).            |
| `order_id`      | uint64\_t | Order ID assigned by the venue.                                                                         |
| `price`         | int64\_t  | Order price (1 unit corresponds to 1e-9, or 0.000000001).                                               |
| `size`          | uint32\_t | Order quantity.                                                                                         |
| `flags`         | uint8\_t  | Bit field indicating event end, message characteristics, and data quality.                              |
| `channel_id`    | uint8\_t  | Channel ID assigned by Databento, incrementing from zero.                                               |
| `action`        | char      | Order event action: **A**dd, **C**ancel, **M**odify, **R** (Clear Book), **T**rade, **F**ill, **N**one. |
| `side`          | char      | Order side: **A**sk (sell order), **B**id (buy order), **N**one (not specified).                        |
| `ts_recv`       | uint64\_t | Timestamp when the event was captured by the server.                                                    |
| `ts_in_delta`   | int32\_t  | Time delta before `ts_recv` (nanoseconds).                                                              |
| `sequence`      | uint32\_t | Message sequence number assigned at the venue.                                                          |

#### **Market by Price (MBP-1)**

**Description**

Market by Price 1 (MBP-1) provides order book updates at the top price level, commonly referred to as **Level 1 (L1) data**.

MBP-1 data includes:

* Best bid and ask price updates
* Order book depth changes
* Executed trades at the top level

**Fields (`mbp-1`)**

| **Field**       | **Type**  | **Description**                                                                               |
| --------------- | --------- | --------------------------------------------------------------------------------------------- |
| `publisher_id`  | uint16\_t | Publisher ID assigned by Databento, denoting dataset and venue.                               |
| `instrument_id` | uint32\_t | Numeric instrument ID.                                                                        |
| `ts_event`      | uint64\_t | Timestamp when the event was received by the matching engine.                                 |
| `price`         | int64\_t  | Order price (1 unit corresponds to 1e-9, or 0.000000001).                                     |
| `size`          | uint32\_t | Order quantity.                                                                               |
| `action`        | char      | Order event action: **A**dd, **C**ancel, **M**odify, **R** (Clear Book), **T**rade, **F**ill. |
| `side`          | char      | Trade aggressor side: **A**sk (sell), **B**id (buy), **N**one (not a trade).                  |
| `flags`         | uint8\_t  | Bit field indicating event end, message characteristics, and data quality.                    |
| `depth`         | uint8\_t  | Book level where update occurred.                                                             |
| `ts_recv`       | uint64\_t | Timestamp when the event was captured by the server.                                          |
| `ts_in_delta`   | int32\_t  | Time delta before `ts_recv` (nanoseconds).                                                    |
| `sequence`      | uint32\_t | Message sequence number assigned at the venue.                                                |
| `bid_px_00`     | int64\_t  | Best bid price.                                                                               |
| `ask_px_00`     | int64\_t  | Best ask price.                                                                               |
| `bid_sz_00`     | uint32\_t | Bid size at the top level.                                                                    |
| `ask_sz_00`     | uint32\_t | Ask size at the top level.                                                                    |
| `bid_ct_00`     | uint32\_t | Number of bid orders at the top level.                                                        |
| `ask_ct_00`     | uint32\_t | Number of ask orders at the top level.                                                        |

### **Receiving Orders**

Market data updates for equities are received and processed in real-time, ensuring accurate and up-to-date information for analysis and trading strategies.
