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
//! # Market Module
//!
//! Provides peg and order book health analysis for stablecoin markets.
//! Uses a **data-driven architecture**: exchange behaviour is described by YAML
//! venue descriptors (see `venues/` directory). A `VenueRegistry` loads all
//! descriptors and creates generic `ExchangeClient` instances at runtime, so
//! new venues can be added without code changes.
//!
//! ## Supported Venues
//!
//! Built-in CEX descriptors: Binance, MEXC, Bitget, Gate.io, Bybit, OKX,
//! Coinbase, Kraken, HTX, Crypto.com, and Biconomy. DEX data (Ethereum, Solana)
//! is synthesized from DexScreener liquidity.
//!
//! ## Usage
//!
//! ```rust,no_run
//! use scope::market::{VenueRegistry, HealthThresholds, MarketSummary};
//!
//! #[tokio::main]
//! async fn main() -> scope::Result<()> {
//! let registry = VenueRegistry::load()?;
//! let exchange = registry.create_exchange_client("binance")?;
//! let pair = exchange.format_pair("USDC");
//! let book = exchange.fetch_order_book(&pair).await?;
//! let summary = MarketSummary::from_order_book(&book, &HealthThresholds::default(), None);
//! print!("{}", summary.format_text(Some("binance")));
//! Ok(())
//! }
//! ```
// Submodules (split from the original monolithic orderbook.rs)
// Data-driven venue system
// Backward-compatible re-export shim (allows `use crate::market::OrderBook` etc.)
pub use ConfigurableExchangeClient;
pub use VenueDescriptor;
pub use ExchangeClient;
pub use ;
pub use VenueRegistry;