Validate market tick sizes and encode precise limit order amounts

This commit is contained in:
2026-12-03 06:34:52 +08:00
parent 00660d890c
commit 2269752b9e
14 changed files with 246 additions and 20 deletions
+5 -1
View File
@@ -58,8 +58,12 @@ impl MinimumSize {
}
pub fn check_shares(&self, qty: i64) -> Result<()> {
self.check_microshares(qty * SCALE)
}
pub fn check_microshares(&self, shares: i64) -> Result<()> {
ensure!(
qty * SCALE >= self.0,
shares >= self.0,
"order is below min_order_size of {} shares",
self.text()
);