From 9ea857298ca75cfcee2541285344abae093954f7 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 26 Sep 2025 17:38:22 -0400 Subject: [PATCH] Add an option `BrokerdPosition.bs_mktid` field Such that backends can deliver their own internal unique `MktPair.bs_mktid` when they can't seem to get it right via the `.fqme: str` export.. (COUGH ib, you piece of sh#$). Also add todo for possibly replacing the msg with a `Position.summary()` "snapshot" as a better and more rigorously generated wire-ready msg. --- piker/clearing/_messages.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/piker/clearing/_messages.py b/piker/clearing/_messages.py index 788fe669..779be0ce 100644 --- a/piker/clearing/_messages.py +++ b/piker/clearing/_messages.py @@ -301,6 +301,9 @@ class BrokerdError(Struct): # TODO: yeah, so we REALLY need to completely deprecate # this and use the `.accounting.Position` msg-type instead.. +# -[ ] an alternative might be to add a `Position.summary() -> +# `PositionSummary`-msg that we generate since `Position` has a lot +# of fields by default we likely don't want to send over the wire? class BrokerdPosition(Struct): ''' Position update event from brokerd. @@ -313,3 +316,4 @@ class BrokerdPosition(Struct): avg_price: float currency: str = '' name: str = 'position' + bs_mktid: str|int|None = None