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
63
64
65
66
67
68
//! Multi-stream data loading for backtest pipeline.
//!
//! ## Architecture
//!
//! ```text
//! ExchangeHubFetcher (REST)
//! └── hub.rest(exchange) → CoreConnector trait methods
//! MarketData: get_klines, get_orderbook, get_recent_trades
//! MarketDataPublic: get_funding_rate_history, get_liquidation_history,
//! get_open_interest_history, get_long_short_ratio_history
//!
//! Subscriber (WS) [mli-collector crate]
//! └── hub.ws(exchange, account_type) → WebSocketConnector::event_stream()
//! StreamEvent → TimedEvent mapping (30+ variants)
//!
//! StorageRoot (накопление)
//! └── Binary log per (exchange, symbol, stream_kind)
//!
//! EnrichedDataLoader (загрузка)
//! └── Merges bars + N streams from any DataSource
//!
//! TimelineMerger (sync по timestamp)
//! └── merge_sorted, bar_boundaries, align_to_bars
//! ```
//!
//! ## REST-capable StreamKinds (via ExchangeHubFetcher)
//!
//! | StreamKind | Trait method |
//! |----------------|--------------------------------------------------|
//! | Bar | `MarketData::get_klines` |
//! | Tick | `MarketDataPublic::get_recent_trades` |
//! | OrderBook | `MarketData::get_orderbook` |
//! | Funding | `MarketDataPublic::get_funding_rate_history` |
//! | Liquidation | `MarketDataPublic::get_liquidation_history` |
//! | OpenInterest | `MarketDataPublic::get_open_interest_history` |
//! | LongShortRatio | `MarketDataPublic::get_long_short_ratio_history` |
//!
//! ## WS-only StreamKinds (no REST history)
//!
//! OrderbookDelta, AggTrade, Ticker, MarkPrice, OptionGreeks, VolatilityIndex,
//! Basis, IndexPrice, CompositeIndex, InsuranceFund, Settlement, BlockTrade,
//! OrderbookL3, RiskLimit, PredictedFunding, FundingSettlement, Auction,
//! MarketWarning, HistoricalVolatility.
//!
//! ## Rule: ALL dig3 connections ONLY through ExchangeHub
//!
//! No direct `ConnectorFactory`, `BinanceConnector`, or `WebSocketPool` imports.
//! Entry point is always `ExchangeHub::rest(id)` or `ExchangeHub::ws(id, at)`.
pub use DataSource;
pub use ExchangeHubFetcher;
pub use EnrichedHistory;
pub use EnrichedDataLoader;
pub use RestFetcher;
pub use StorageRoot;
pub use StreamKind;
pub use TimedEvent;
pub use ;