nautilus_tardis/config.rs
1// -------------------------------------------------------------------------------------------------
2// Copyright (C) 2015-2025 Nautech Systems Pty Ltd. All rights reserved.
3// https://nautechsystems.io
4//
5// Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6// You may not use this file except in compliance with the License.
7// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16use serde::{Deserialize, Serialize};
17
18use super::machine::types::ReplayNormalizedRequestOptions;
19
20/// Determines the output format for Tardis `book_snapshot_*` messages.
21#[derive(Debug, Clone, Default, Serialize, Deserialize)]
22#[serde(rename_all = "snake_case")]
23pub enum BookSnapshotOutput {
24 /// Convert book snapshots to `OrderBookDeltas` and write to `order_book_deltas/`.
25 #[default]
26 Deltas,
27 /// Convert book snapshots to `OrderBookDepth10` and write to `order_book_depths/`.
28 Depth10,
29}
30
31/// Provides a configuration for a Tarid Machine -> Nautilus data -> Parquet replay run.
32#[derive(Debug, Clone, Serialize, Deserialize)]
33pub struct TardisReplayConfig {
34 /// The Tardis Machine websocket url.
35 pub tardis_ws_url: Option<String>,
36 /// If symbols should be normalized with Nautilus conventions.
37 pub normalize_symbols: Option<bool>,
38 /// The output directory for writing Nautilus format Parquet files.
39 pub output_path: Option<String>,
40 /// The Tardis Machine replay options.
41 pub options: Vec<ReplayNormalizedRequestOptions>,
42 /// Optional WebSocket proxy URL.
43 ///
44 /// Note: WebSocket proxy support is not yet implemented. This field is reserved
45 /// for future functionality.
46 pub ws_proxy_url: Option<String>,
47 /// The output format for `book_snapshot_*` messages.
48 ///
49 /// - `deltas`: Convert to `OrderBookDeltas` and write to `order_book_deltas/` (default).
50 /// - `depth10`: Convert to `OrderBookDepth10` and write to `order_book_depths/`.
51 pub book_snapshot_output: Option<BookSnapshotOutput>,
52}