nautilus_schwab/lib.rs
1//! # nautilus-schwab
2//!
3//! Charles Schwab adapter for [Nautilus Trader](https://nautilustrader.io/).
4//!
5//! This crate provides a Rust-native adapter that connects Nautilus Trader
6//! to Charles Schwab's Trader API, Market Data API, and real-time streamer.
7//!
8//! ## Architecture
9//!
10//! The adapter translates between [`schwab-sdk`] types and Nautilus domain types,
11//! implementing the standard `DataClient` and `ExecutionClient` traits.
12//!
13//! ```text
14//! ┌─────────────────────────────────────────────────┐
15//! │ Nautilus Trader Engine │
16//! │ ┌──────────────┐ ┌────────────────────────┐ │
17//! │ │ SchwabData │ │ SchwabExecution │ │
18//! │ │ Client │ │ Client │ │
19//! │ └──────┬───────┘ └──────────┬─────────────┘ │
20//! │ │ │ │
21//! │ ┌──────▼───────────────────────▼─────────────┐ │
22//! │ │ schwab-sdk 0.5 (Rust crate) │ │
23//! │ │ accounts · orders · market_data · streamer │ │
24//! │ └──────────────────┬─────────────────────────┘ │
25//! │ │ │
26//! │ ┌──────────────────▼─────────────────────────┐ │
27//! │ │ TokenProvider impl (refresh-on-demand) │ │
28//! │ └────────────────────────────────────────────┘ │
29//! └─────────────────────────────────────────────────┘
30//! ```
31//!
32//! ## V1 Capability Matrix
33//!
34//! | Capability | Status | Notes |
35//! |---|---|---|
36//! | US Equities & ETFs | ✅ Planned | Primary target |
37//! | Market Orders | ✅ Planned | |
38//! | Limit Orders | ✅ Planned | Via `OrderRequest::buy_limit()` etc. |
39//! | Stop Orders | ✅ Planned | |
40//! | Real-time Quotes | ✅ Planned | Via `client.streamer()` |
41//! | Real-time Bars | ✅ Planned | Via `client.streamer()` |
42//! | Account Balance | ✅ Planned | |
43//! | Position Reconciliation | ✅ Planned | Startup mass-status |
44//! | OAuth Token Refresh | ✅ Planned | Automatic via TokenProvider |
45//! | Options | ❌ V2 | |
46//! | Futures | ❌ V2 | |
47//! | Forex | ❌ V2 | |
48//! | OCO/Bracket Orders | ❌ V2 | |
49//! | Historical Bar Bulk | ❌ V2 | Single requests OK |
50
51pub mod common;
52pub mod http;
53pub mod oauth;
54
55pub mod data;
56pub mod execution;
57pub mod factories;
58
59#[cfg(feature = "python")]
60pub mod python;
61
62// Re-export key types for convenience
63pub use common::credential::SchwabCredential;
64pub use common::symbol::SchwabSymbol;
65pub use oauth::provider::SchwabTokenProvider;
66
67/// Adapter venue identifier used in Nautilus InstrumentId values.
68pub const VENUE: &str = "SCHWAB";