Martingale42/nautilus-dev / skills/nt-adapters
nt-adapters
VerifiedUse when working with exchange or data provider adapters, HTTP/WebSocket clients, instrument providers, or venue integration in NautilusTrader.
references/examples/rust_adapters/tardis/node_data_tester.rs
View on GitHub// -------------------------------------------------------------------------------------------------
// Copyright (C) 2015-2026 Nautech Systems Pty Ltd. All rights reserved.
// https://nautechsystems.io
//
// Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -------------------------------------------------------------------------------------------------
//! Sandbox example replaying Tardis Machine data through a LiveNode.
//!
//! Run with: `cargo run --example tardis-data-tester -p nautilus-tardis`
//!
//! Prerequisites:
//! - Set `TARDIS_API_KEY` (used by the HTTP client to fetch instrument metadata)
//! - Set `TM_API_KEY` (used by the tardis-machine Docker container)
//! - Set `TARDIS_MACHINE_WS_URL=ws://localhost:8001`
//! - `docker run --platform linux/amd64 -p 8000:8000 -p 8001:8001 -e TM_API_KEY -d tardisdev/tardis-machine`
use chrono::NaiveDate;
use nautilus_common::enums::Environment;
use nautilus_live::node::LiveNode;
use nautilus_model::identifiers::{ClientId, InstrumentId, TraderId};
use nautilus_tardis::{
config::TardisDataClientConfig, enums::TardisExchange, factories::TardisDataClientFactory,
machine::types::ReplayNormalizedRequestOptions,
};
use nautilus_testkit::testers::{DataTester, DataTesterConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
dotenvy::dotenv().ok();
let options = vec![ReplayNormalizedRequestOptions {
exchange: TardisExchange::BinanceFutures,
symbols: Some(vec!["BTCUSDT".to_string()]),
from: NaiveDate::from_ymd_opt(2024, 1, 1).unwrap(),
to: NaiveDate::from_ymd_opt(2024, 1, 2).unwrap(),
data_types: vec!["trade".to_string(), "book_change".to_string()],
with_disconnect_messages: Some(false),
}];
let tardis_config = TardisDataClientConfig {
options,
..Default::default()
};
let client_id = ClientId::new("TARDIS");
let instrument_ids = vec![InstrumentId::from("BTCUSDT-PERP.BINANCE")];
let mut node = LiveNode::builder(TraderId::from("TESTER-001"), Environment::Sandbox)?
.with_name("TARDIS-SANDBOX")
.with_delay_post_stop_secs(2)
.add_data_client(
None,
Box::new(TardisDataClientFactory::new()),
Box::new(tardis_config),
)?
.build()?;
let tester_config = DataTesterConfig::new(client_id, instrument_ids)
.with_subscribe_trades(true)
.with_subscribe_book_deltas(true);
let tester = DataTester::new(tester_config);
node.add_actor(tester)?;
node.run().await?;
Ok(())
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |