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
//! Strategy module containing pure mathematical calculations for market making.
//!
//! This module implements various market making strategies:
//! - Avellaneda-Stoikov model using stochastic control theory
//! - Guéant-Lehalle-Fernandez-Tapia (GLFT) model extension
//! - Grid trading for ranging markets
//! - Depth-based offering
//! - Adaptive spread based on order book imbalance
//!
//! # Key Formulas (Avellaneda-Stoikov)
//!
//! ## Reservation Price
//! ```text
//! r = s - q * γ * σ² * (T - t)
//! ```
//!
//! ## Optimal Spread
//! ```text
//! spread = γ * σ² * (T - t) + (2/γ) * ln(1 + γ/k)
//! ```
//!
//! ## Optimal Quotes
//! ```text
//! bid = reservation_price - spread/2
//! ask = reservation_price + spread/2
//! ```
/// Core Avellaneda-Stoikov model calculations.
/// Quote generation logic.
/// Strategy configuration.
/// Depth-based offering strategy.
/// Grid trading strategy.
/// Adaptive spread based on order book imbalance.
/// Guéant-Lehalle-Fernandez-Tapia (GLFT) model extension.
/// Parameter calibration tools for strategy optimization.