Match fractional share lots and preserve order quantities across restart

This commit is contained in:
2026-12-03 07:01:24 +08:00
parent 2c4179a64e
commit 064b301ebd
27 changed files with 343 additions and 111 deletions
+2 -2
View File
@@ -42,8 +42,8 @@ impl OrderBook {
}
}
/// Buy whole shares at maker prices. Budget and limit use the instrument's
/// integer tick unit (total cash in ticks and ticks per share respectively).
/// Buy integer lots at maker prices. Express the budget in price ticks
/// multiplied by quantity lots, the same units as price * remaining.
pub fn match_budget_buy(&self, seq: i64, limit: i64, budget: i64) -> Vec<Fill> {
let mut cash = budget;
let mut capacity = i64::MAX;