1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! # rustrade-core
//!
//! Core types and traits for the rustrade trading bot framework.
//!
//! This crate is the type-layer foundation used by every other crate in the
//! `rustrade` ecosystem. It is deliberately dependency-light and contains
//! **no I/O, no async runtime state, and no exchange-specific logic**.
//!
//! # What lives here
//!
//! - Domain types: [`Price`], [`Volume`], [`Candle`], [`Tick`], [`Order`], [`Fill`], [`Position`]
//! - Trading intents: [`Signal`], [`Decision`], [`SizeHint`]
//! - Trait contracts: [`Brain`], [`ExchangeClient`], [`MarketSource`]
//! - Broadcast buses: [`MarketDataBus`], [`SignalBus`]
//! - State persistence: [`StateStore`], [`InMemoryStore`]
//! - Error types: [`Error`], [`Result`]
//!
//! # What does NOT live here
//!
//! - Service lifecycle / supervision → `rustrade-supervisor`
//! - Risk calculations → `rustrade-risk`
//! - Backtest replay → `rustrade-backtest`
//! - Exchange clients → separate crates (e.g. `exchange-apiws`)
//! - Indicator implementations → separate crates (e.g. `indicators-ta`)
//!
//! # Design principles
//!
//! 1. **Zero runtime deps beyond tokio primitives.** No HTTP, no Redis, no
//! tracing-subscriber, no prometheus. Downstream crates add those.
//! 2. **Newtype wrappers for numeric quantities** to prevent unit confusion.
//! 3. **Traits are narrow.** Implementors should not need to stub dozens
//! of methods they don't care about.
//! 4. **Traits are object-safe where possible** so `Box<dyn Brain>` works.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;