Module reconciliation

Module reconciliation 

Source
Expand description

Execution state reconciliation functions.

Pure functions for reconciling orders and positions between local state and venue reports.

Structs§

FillSnapshot
Immutable snapshot of fill data for position simulation.
ReconciliationResult
Result of processing fill reports for reconciliation.
VenuePositionSnapshot
Represents a position snapshot from the venue.

Enums§

FillAdjustmentResult
Result of the fill adjustment process.

Functions§

adjust_fills_for_partial_window
Adjust fills for partial reconciliation window to handle incomplete position lifecycles.
calculate_reconciliation_price
Calculate the price needed for a reconciliation order to achieve target position.
check_position_match
Check if simulated position matches venue position within tolerance.
create_inferred_fill
Creates an inferred fill event for reconciliation when fill reports are missing.
create_reconciliation_accepted
Creates an OrderAccepted event for reconciliation.
create_reconciliation_canceled
Creates an OrderCanceled event for reconciliation.
create_reconciliation_expired
Creates an OrderExpired event for reconciliation.
create_reconciliation_rejected
Creates an OrderRejected event for reconciliation.
create_reconciliation_triggered
Creates an OrderTriggered event for reconciliation.
create_reconciliation_updated
Creates an OrderUpdated event for reconciliation.
create_synthetic_fill_report
Create a synthetic FillReport from a FillSnapshot.
create_synthetic_order_report
Create a synthetic OrderStatusReport from a FillSnapshot.
create_synthetic_trade_id
Create a synthetic TradeId using timestamp and UUID suffix.
create_synthetic_venue_order_id
Create a synthetic VenueOrderId using timestamp and UUID suffix.
detect_zero_crossings
Detect zero-crossing timestamps in a sequence of fills.
generate_external_order_status_events
Generates the appropriate order events for an external order and order status report.
process_mass_status_for_reconciliation
Process fill reports from a mass status for position reconciliation.
reconcile_order_report
Reconciles an order with a venue status report, generating appropriate events.
should_reconciliation_update
Checks if the order should be updated based on quantity, price, or trigger price differences from the venue report.
simulate_position
Simulate position from chronologically ordered fills using netting logic.