Expand description
Execution state reconciliation functions.
Pure functions for reconciling orders and positions between local state and venue reports.
Structs§
- Fill
Snapshot - Immutable snapshot of fill data for position simulation.
- Reconciliation
Result - Result of processing fill reports for reconciliation.
- Venue
Position Snapshot - Represents a position snapshot from the venue.
Enums§
- Fill
Adjustment Result - 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.
- check_
position_ reconciliation - Reconciles a position status report, comparing venue state with local state.
- create_
incremental_ inferred_ fill - Creates an inferred fill for the quantity difference between order and report.
- create_
inferred_ fill - Creates an inferred fill event for reconciliation when fill reports are missing.
- create_
inferred_ fill_ for_ qty - Creates an inferred fill with a specific quantity.
- 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
FillReportfrom aFillSnapshot. - create_
synthetic_ order_ report - Create a synthetic
OrderStatusReportfrom aFillSnapshot. - create_
synthetic_ trade_ id - Create a synthetic
TradeIdusing timestamp and UUID suffix. - create_
synthetic_ venue_ order_ id - Create a synthetic
VenueOrderIdusing 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.
- is_
within_ single_ unit_ tolerance - Checks if two decimal values are within a single unit of tolerance for the given precision.
- process_
mass_ status_ for_ reconciliation - Process fill reports from a mass status for position reconciliation.
- reconcile_
fill_ report - Creates an OrderFilled event from a FillReport.
- 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.