Enforce FOK, FAK and post-only constraints before applying fills

This commit is contained in:
2026-12-03 03:45:40 +08:00
parent d6eef2f07f
commit 4eb80fa458
6 changed files with 107 additions and 18 deletions
+12 -4
View File
@@ -39,8 +39,10 @@ pub(crate) enum Command {
side: String,
price: i64,
qty: i64,
#[serde(default = "gtc")]
tif: String,
#[serde(default)]
tif: TimeInForce,
#[serde(default)]
post_only: bool,
},
Cancel {
account: String,
@@ -65,6 +67,12 @@ pub(crate) enum Command {
winner: String,
},
}
fn gtc() -> String {
"GTC".into()
#[derive(Clone, Copy, Default, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "UPPERCASE")]
pub(crate) enum TimeInForce {
#[default]
Gtc,
Ioc,
Fak,
Fok,
}