fix: enforce actual venue persistence contract

This commit is contained in:
Hermes Agent
2026-08-19 12:53:56 +09:00
parent 7366cadf03
commit 359ea098ff
5 changed files with 99 additions and 10 deletions
+2 -2
View File
@@ -71,8 +71,8 @@ class OrderAck:
accepted: bool
broker_order_id: Optional[str] = None
reason: Optional[str] = None
# Actual venue used for submission. Execution persists this value with the
# broker order id so restart/cancel never has to infer the original venue.
# Original submission/routing venue. Execution persists this with the
# broker order id so restart/cancel never infer it from wall-clock time.
venue: Optional[str] = None
raw: dict[str, Any] = field(default_factory=dict)
submitted_at: Optional[datetime] = None
+3 -2
View File
@@ -57,8 +57,9 @@ class LedgerTrade:
fee: float = 0.0
tax: float = 0.0
executed_at: Optional[datetime] = None
# Broker-authoritative execution exchange (KRX/NXT).
venue: str = "KRX"
# Broker-authoritative execution exchange (KRX/NXT). Historical rows whose
# SOR execution exchange cannot be reconstructed are None.
venue: Optional[str] = None
# Original submission/routing venue (KRX/NXT/SOR), retained for audit.
order_venue: str = "KRX"