Skip to content

Commit 8eea03c

Browse files
committed
Refine Databento integration guide
1 parent 3caf3a7 commit 8eea03c

1 file changed

Lines changed: 15 additions & 17 deletions

File tree

docs/integrations/databento.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ The following Databento schemas are supported by NautilusTrader:
6969
| Databento schema | Nautilus data type | Description |
7070
|:-----------------|:----------------------------------|:--------------------------------|
7171
| MBO | `OrderBookDelta` | Market by order (L3). |
72-
| MBP_1 | `(QuoteTick, TradeTick | None)` | Market by price (L1). |
72+
| MBP_1 | `(QuoteTick, TradeTick \| None)` | Market by price (L1). |
7373
| MBP_10 | `OrderBookDepth10` | Market depth (L2). |
7474
| BBO_1S | `QuoteTick` | 1-second best bid/offer. |
7575
| BBO_1M | `QuoteTick` | 1-minute best bid/offer. |
76-
| CMBP_1 | `(QuoteTick, TradeTick | None)` | Consolidated MBP across venues. |
76+
| CMBP_1 | `(QuoteTick, TradeTick \| None)` | Consolidated MBP across venues. |
7777
| CBBO_1S | `QuoteTick` | Consolidated 1-second BBO. |
7878
| CBBO_1M | `QuoteTick` | Consolidated 1-minute BBO. |
7979
| TCBBO | `(QuoteTick, TradeTick)` | Trade-sampled consolidated BBO. |
@@ -93,10 +93,10 @@ The following Databento schemas are supported by NautilusTrader:
9393

9494
- **TBBO and TCBBO**: Trade-sampled feeds that pair every trade with the BBO immediately *before* the trade's effect (TBBO per-venue, TCBBO consolidated across venues). Use when you need trades aligned with contemporaneous quotes without managing two streams.
9595
- **MBP-1 and CMBP-1 (L1)**: Event-level updates; emit trades only on trade events. Choose for a complete top-of-book event tape. For quote+trade alignment, prefer TBBO/TCBBO; otherwise, use TRADES.
96-
- **MBP-10 (L2)**: (top 10 levels) with trades. Good for depth-aware strategies that don't need per-order detail; lighter than MBO with much of the structure you need including number of orders per level.
96+
- **MBP-10 (L2)**: Top 10 levels with trades. Good for depth-aware strategies that don't need per-order detail; lighter than MBO with much of the structure you need including number of orders per level.
9797
- **MBO (L3)**: Per-order events enable queue position modeling and exact book reconstruction. Highest volume/cost; start at node initialization to ensure proper replay context.
9898
- **BBO_1S/BBO_1M and CBBO_1S/CBBO_1M**: Sampled top-of-book quotes at fixed intervals (1s/1m), no trades. Best for monitoring/spreads/low-cost signal generation; not suited for fine-grained microstructure.
99-
- **TRADES**: Trades only. Pair with MBP-1 (include_trades=True) or use TBBO/TCBBO if you need quote context aligned with trades.
99+
- **TRADES**: Trades only. Pair with MBP-1 (`include_trades=True`) or use TBBO/TCBBO if you need quote context aligned with trades.
100100
- **OHLCV_ (incl. OHLCV_EOD)**: Aggregated bars derived from trades. Prefer for higher-timeframe analytics/backtests; ensure bar timestamps represent close time (set `bars_timestamp_on_close=True`).
101101
- **Imbalance / Statistics / Status**: Venue operational data; subscribe via `subscribe_data` with a `DataType` carrying `instrument_id` metadata.
102102

@@ -112,7 +112,17 @@ See also the Databento [Schemas and data formats](https://databento.com/docs/sch
112112

113113
## Schema selection for live subscriptions
114114

115-
:::info
115+
The following table shows how Nautilus subscription methods map to Databento schemas:
116+
117+
| Nautilus Subscription Method | Default Schema | Available Databento Schemas | Nautilus Data Type |
118+
|:--------------------------------|:---------------|:-----------------------------------------------------------------------------|:-------------------|
119+
| `subscribe_quote_ticks()` | `mbp-1` | `mbp-1`, `bbo-1s`, `bbo-1m`, `cmbp-1`, `cbbo-1s`, `cbbo-1m`, `tbbo`, `tcbbo` | `QuoteTick` |
120+
| `subscribe_trade_ticks()` | `trades` | `trades`, `tbbo`, `tcbbo`, `mbp-1`, `cmbp-1` | `TradeTick` |
121+
| `subscribe_order_book_depth()` | `mbp-10` | `mbp-10` | `OrderBookDepth10` |
122+
| `subscribe_order_book_deltas()` | `mbo` | `mbo` | `OrderBookDeltas` |
123+
| `subscribe_bars()` | varies | `ohlcv-1s`, `ohlcv-1m`, `ohlcv-1h`, `ohlcv-1d` | `Bar` |
124+
125+
:::note
116126
The examples below assume you're within a `Strategy` or `Actor` class context where `self` has access to subscription methods.
117127
Remember to import the necessary types:
118128

@@ -124,18 +134,6 @@ from nautilus_trader.model.identifiers import InstrumentId
124134

125135
:::
126136

127-
### Nautilus subscription methods to Databento schemas
128-
129-
The following table shows how Nautilus subscription methods map to Databento schemas:
130-
131-
| Nautilus Subscription Method | Default Schema | Available Databento Schemas | Nautilus Data Type |
132-
|:--------------------------------|:---------------|:-----------------------------------------------------------------------------|:-------------------|
133-
| `subscribe_quote_ticks()` | `mbp-1` | `mbp-1`, `bbo-1s`, `bbo-1m`, `cmbp-1`, `cbbo-1s`, `cbbo-1m`, `tbbo`, `tcbbo` | `QuoteTick` |
134-
| `subscribe_trade_ticks()` | `trades` | `trades`, `tbbo`, `tcbbo`, `mbp-1`, `cmbp-1` | `TradeTick` |
135-
| `subscribe_order_book_depth()` | `mbp-10` | `mbp-10` | `OrderBookDepth10` |
136-
| `subscribe_order_book_deltas()` | `mbo` | `mbo` | `OrderBookDeltas` |
137-
| `subscribe_bars()` | varies | `ohlcv-1s`, `ohlcv-1m`, `ohlcv-1h`, `ohlcv-1d` | `Bar` |
138-
139137
### Quote subscriptions (MBP / L1)
140138

141139
```python

0 commit comments

Comments
 (0)