Emit futures order process events

This commit is contained in:
boris
2026-04-23 20:41:37 -07:00
parent dfd39fd8a3
commit 4755a59a5b
4 changed files with 101 additions and 1 deletions

View File

@@ -85,6 +85,12 @@ fn futures_order_execution_splits_close_between_old_and_today_quantity() {
assert_eq!(report.order_events.len(), 1);
assert_eq!(report.order_events[0].status, OrderStatus::Filled);
assert!(
report
.process_events
.iter()
.any(|event| event.kind == fidc_core::ProcessEventKind::Trade)
);
assert_eq!(report.fill_events[0].quantity, 4);
assert!((report.fill_events[0].net_cash_flow - 19_196.0).abs() < 1e-6);
let position = account
@@ -120,6 +126,12 @@ fn futures_close_today_rejects_when_today_quantity_is_insufficient() {
assert_eq!(report.order_events.len(), 1);
assert_eq!(report.order_events[0].status, OrderStatus::Rejected);
assert!(
report
.process_events
.iter()
.any(|event| event.kind == fidc_core::ProcessEventKind::OrderCreationReject)
);
assert!(
report.order_events[0]
.reason
@@ -174,6 +186,14 @@ fn futures_expiration_settlement_closes_all_contract_directions() {
assert_eq!(report.order_events.len(), 2);
assert_eq!(report.fill_events.len(), 2);
assert_eq!(
report
.process_events
.iter()
.filter(|event| event.kind == fidc_core::ProcessEventKind::Trade)
.count(),
2
);
assert!(
report
.order_events