pub struct Limits {
pub allowed_markets: Option<HashSet<String>>,
pub allowed_symbols: Option<HashSet<String>>,
pub max_order_value: Option<f64>,
pub max_daily_value: Option<f64>,
pub hours_window: Option<String>,
pub max_orders_per_minute: Option<u32>,
pub allowed_trd_sides: Option<HashSet<String>>,
}Expand description
限额配置(与 KeyRecord 字段平级,独立出来便于传递)
Fields§
§allowed_markets: Option<HashSet<String>>§allowed_symbols: Option<HashSet<String>>§max_order_value: Option<f64>§max_daily_value: Option<f64>§hours_window: Option<String>§max_orders_per_minute: Option<u32>每分钟下单次数上限(滑动窗口,None 表示不限)。挡 spray-and-pray 类攻击:即使每单小于 max_order_value、日累计也够,也限制速率。
allowed_trd_sides: Option<HashSet<String>>允许的交易方向白名单:例如 ["SELL"] = 只让平仓 bot 卖;
None / 空集 → 不限。大小写敏感,用 "BUY" / "SELL" / "SELL_SHORT" / "BUY_BACK"。
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Limits
impl<'de> Deserialize<'de> for Limits
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnwindSafe for Limits
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more