Settle sub-cent orders and migrate historical book prices

This commit is contained in:
2026-12-03 07:07:25 +08:00
parent 064b301ebd
commit 20ce08adf9
32 changed files with 393 additions and 138 deletions
+1 -2
View File
@@ -68,8 +68,7 @@ impl MinimumSize {
pub fn check_budget(&self, cents: i64, max_price: i64, fee_rate: i64) -> Result<()> {
let lots = (self.0 + crate::lots::MICROS - 1) / crate::lots::MICROS;
let required =
lots * max_price * 100 + crate::fees::lot_fee(fee_rate, max_price * 10000, lots);
let required = lots * max_price + crate::fees::lot_fee(fee_rate, max_price * 100, lots);
ensure!(
cents * 10000 >= required,
"cash budget at protection price is below min_order_size of {} shares",