Reconcile precise collateral funding, fee debits and available cash

This commit is contained in:
2026-12-03 06:30:11 +08:00
parent 2fcdac61d5
commit 14ccc97e09
14 changed files with 207 additions and 41 deletions
+2 -1
View File
@@ -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",