Validate market tick sizes and encode precise limit order amounts
This commit is contained in:
@@ -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()
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user