feat(execution): reconcile timed-out orders safely
This commit is contained in:
@@ -213,6 +213,9 @@ class SlotService:
|
||||
venue="KRX",
|
||||
cancel_state=None,
|
||||
cancel_requested_at=None,
|
||||
order_submitted_at=None,
|
||||
order_date=None,
|
||||
cancel_attempts=0,
|
||||
updated_at=datetime.now(tz=timezone.utc),
|
||||
)
|
||||
|
||||
@@ -287,6 +290,21 @@ class SlotService:
|
||||
venue=new_venue,
|
||||
cancel_state=None,
|
||||
cancel_requested_at=None,
|
||||
order_submitted_at=(
|
||||
slot.order_submitted_at
|
||||
if to_state in {SlotState.PENDING_BUY, SlotState.PENDING_SELL}
|
||||
else None
|
||||
),
|
||||
order_date=(
|
||||
slot.order_date
|
||||
if to_state in {SlotState.PENDING_BUY, SlotState.PENDING_SELL}
|
||||
else None
|
||||
),
|
||||
cancel_attempts=(
|
||||
slot.cancel_attempts
|
||||
if to_state in {SlotState.PENDING_BUY, SlotState.PENDING_SELL}
|
||||
else 0
|
||||
),
|
||||
updated_at=datetime.now(tz=timezone.utc),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user