Enforce FOK, FAK and post-only constraints before applying fills
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user