Reconcile precise collateral funding, fee debits and available cash
This commit is contained in:
@@ -70,7 +70,8 @@ impl MinimumSize {
|
||||
// Whole shares are the simulator's executable quantity unit. The
|
||||
// submitted cash cap includes the taker fee at the protection price.
|
||||
let qty = (self.0 + SCALE - 1) / SCALE;
|
||||
let required = qty * max_price * 10000 + crate::fees::micros(fee_rate, max_price, qty);
|
||||
let required =
|
||||
qty * max_price * 10000 + crate::fees::micros(fee_rate, max_price * 10000, qty);
|
||||
ensure!(
|
||||
cents * 10000 >= required,
|
||||
"cash budget at protection price is below min_order_size of {} shares",
|
||||
|
||||
Reference in New Issue
Block a user