Source: https://databento.com/docs/schemas/bbo


# BBO on interval (BBO)

**BBO on interval (BBO)** provides the last best bid, best offer, and sale at 1-second or 1-minute intervals. This is a subset of [MBP-1](https://databento.com/docs/schemas/mbp-1.md).

Databento groups this under [top of book](https://databento.com/docs/schemas/whats-a-schema.md#supported-schemas-and-their-fields) (L1).

Databento adopts the following convention for BBO:

- The time interval is indicated by the schema ID's suffix: `-1s` for 1-second and `-1m` for 1-minute.
- If no trade or BBO update occurs within the interval, no record is printed.
- If a BBO update occurs but no trade takes place within the interval, the last sale information is forward-filled from the previous interval.
- If no BBO update occurs but a trade takes place within the interval, the BBO information is forward-filled from the previous interval.

### Fields (`bbo-1s` and `bbo-1m`)

| Field | Type | Description |
| `ts_recv` | uint64\_t | The end timestamp of the interval, clamped to the second/minute boundary, expressed as the number of nanoseconds since the UNIX epoch. |
| `ts_event` | uint64\_t | The matching-engine-received timestamp of the last trade for the instrument expressed as the number of nanoseconds since the UNIX epoch. Will be `UNDEF_TIMESTAMP` in cases where there was no last trade in the session. See [ts_event](https://databento.com/docs/conventions/common-fields-enums-types.md#ts-event). |
| `rtype` | uint8\_t | A sentinel value indicating the record type. Can be either 195 (`BBO-1s`) or 196 (`BBO-1m`). See [Rtype](https://databento.com/docs/conventions/common-fields-enums-types.md#rtype). |
| `publisher_id` | uint16\_t | The publisher ID assigned by Databento, which denotes the dataset and venue. See [Publishers](https://databento.com/docs/conventions/common-fields-enums-types.md#publishers-datasets-and-venues). |
| `instrument_id` | uint32\_t | The numeric instrument ID. See [Instrument identifiers](https://databento.com/docs/conventions/common-fields-enums-types.md#instrument-identifiers). |
| `side` | char | The side that initiated the last trade. Can be **A**sk for a sell aggressor in a trade, **B**id for a buy aggressor in a trade, or **N**one where no side is specified. See [Side](https://databento.com/docs/conventions/common-fields-enums-types.md#side). |
| `price` | int64\_t | The last trade price where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001. Will be `UNDEF_PRICE` if there was no last trade in the session. See [Prices](https://databento.com/docs/conventions/common-fields-enums-types.md#prices). |
| `size` | uint32\_t | The last trade quantity. Will be 0 if there was no last trade in the session. |
| `flags` | uint8\_t | A bit field indicating event end, message characteristics, and data quality. See [Flags](https://databento.com/docs/conventions/common-fields-enums-types.md#flags). |
| `sequence` | uint32\_t | The message sequence number assigned at the venue of the last update. |
| `bid_px_00` | int64\_t | The bid price at the top level where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001. See [Prices](https://databento.com/docs/conventions/common-fields-enums-types.md#prices). |
| `ask_px_00` | int64\_t | The ask price at the top level where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001. See [Prices](https://databento.com/docs/conventions/common-fields-enums-types.md#prices). |
| `bid_sz_00` | uint32\_t | The bid size at the top level. |
| `ask_sz_00` | uint32\_t | The ask size at the top level. |
| `bid_ct_00` | uint32\_t | The bid order count at the top level. |
| `ask_ct_00` | uint32\_t | The ask order count at the top level. |

##### Consolidated BBO on interval (CBBO)

**Consolidated BBO on interval (CBBO)** provides the consolidated last best bid, best offer, and sale at 1-second or 1-minute intervals. This is a subset of [CMBP-1](https://databento.com/docs/schemas/mbp-1.md#consolidated-market-by-price-cmbp-1).

Databento adopts the following convention for CBBO:

- The time interval is indicated by the schema ID's suffix: `-1s` for 1-second and `-1m` for 1-minute.
- If no trade or CBBO update occurs within the interval, no record is printed.
- If a CBBO update occurs but no trade takes place within the interval, the last sale information is forward-filled from the previous interval.
- If no CBBO update occurs but a trade takes place within the interval, the CBBO information is forward-filled from the previous interval.

### Fields (`cbbo-1s` and `cbbo-1m`)

| Field | Type | Description |
| `ts_recv` | uint64\_t | The end timestamp of the interval, clamped to the second/minute boundary. |
| `ts_event` | uint64\_t | The matching-engine-received timestamp of the last trade for the instrument expressed as the number of nanoseconds since the UNIX epoch. Will be `UNDEF_TIMESTAMP` in cases where there was no last trade in the session. See [ts_event](https://databento.com/docs/conventions/common-fields-enums-types.md#ts-event). |
| `rtype` | uint8\_t | A sentinel value indicating the record type. Can be either 192 (`CBBO-1s`) or 193 (`CBBO-1m`). See [Rtype](https://databento.com/docs/conventions/common-fields-enums-types.md#rtype). |
| `publisher_id` | uint16\_t | The consolidated publisher ID. See [Publishers](https://databento.com/docs/conventions/common-fields-enums-types.md#publishers-datasets-and-venues). |
| `instrument_id` | uint32\_t | The numeric instrument ID. See [Instrument identifiers](https://databento.com/docs/conventions/common-fields-enums-types.md#instrument-identifiers). |
| `side` | char | The side that initiated the last trade. Can be **A**sk for a sell aggressor in a trade, **B**id for a buy aggressor in a trade, or **N**one where no side is specified. See [Side](https://databento.com/docs/conventions/common-fields-enums-types.md#side). |
| `price` | int64\_t | The last trade price where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001. Will be `UNDEF_PRICE` if there was no last trade in the session. See [Prices](https://databento.com/docs/conventions/common-fields-enums-types.md#prices). |
| `size` | uint32\_t | The last trade quantity. Will be 0 if there was no last trade in the session. |
| `flags` | uint8\_t | A bit field indicating event end, message characteristics, and data quality. See [Flags](https://databento.com/docs/conventions/common-fields-enums-types.md#flags). |
| `bid_px_00` | int64\_t | The bid price at the top level where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001. See [Prices](https://databento.com/docs/conventions/common-fields-enums-types.md#prices). |
| `ask_px_00` | int64\_t | The ask price at the top level where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001. See [Prices](https://databento.com/docs/conventions/common-fields-enums-types.md#prices). |
| `bid_sz_00` | uint32\_t | The bid size at the top level. |
| `ask_sz_00` | uint32\_t | The ask size at the top level. |
| `bid_pb_00` | uint16\_t | The publisher ID indicating the venue containing the best bid. See [Publishers](https://databento.com/docs/conventions/common-fields-enums-types.md#publishers-datasets-and-venues). |
| `ask_pb_00` | uint16\_t | The publisher ID indicating the venue containing the best ask. See [Publishers](https://databento.com/docs/conventions/common-fields-enums-types.md#publishers-datasets-and-venues). |

### CBBO publisher

The `publisher_id` field will always be the consolidated publisher ID for the dataset.

`bid_pb_00` and `ask_pb_00` will represent the individual venues showing the NBBO at the end of the interval.

### Implementation differences between clients and encodings

Bid and ask depth messages (fields starting with `bid_` and `ask_`) are structured differently in the **C++ and Rust clients**, **the Python record interface**, and **JSON data**. Instead of using the `_N` suffix, they're stored in an array of structures named levels, with the top-of-book at index `0`.

For example, in C++, `levels[5].bid_px` corresponds to `bid_px_05` in the Python DataFrame API and CSV format.

> **See also**
>
> CBBO has many similarities to the CMBP-1 and TCBBO schemas. The main distinction is that CBBO is in time space, while CMBP-1 is in book update space, and TCBBO is in trade space. Learn about the differences between each in our [CMBP-1 vs. TCBBO vs. CBBO schemas guide](https://databento.com/docs/faqs/difference-between-mbp-and-tbbo.md).
