fts_solver/types/auth.rs
1use super::spvec;
2use std::hash::Hash;
3
4// A portfolio is a direction in product space
5spvec!(Portfolio);
6
7/// An authorization defines a decision variable for trading.
8/// It specifies the allowable trade range and the portfolio composition.
9///
10/// The min_trade and max_trade values define bounds on how much of the portfolio
11/// can be traded. For example:
12/// - For buy-only: min_trade = 0.0, max_trade > 0.0
13/// - For sell-only: min_trade < 0.0, max_trade = 0.0
14/// - For two-sided: min_trade < 0.0, max_trade > 0.0
15#[derive(Debug)]
16pub struct Auth<T: Eq + Hash> {
17 /// Minimum allowable trade quantity (typically <= 0)
18 pub min_trade: f64,
19 /// Maximum allowable trade quantity (typically >= 0)
20 pub max_trade: f64,
21 /// The composition of the portfolio being traded
22 pub portfolio: Portfolio<T>,
23}