From 461764419d584fa6db942d02c1504eac0c796499 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 25 Aug 2023 12:10:06 -0400 Subject: [PATCH] ib.api: always key `._contracts` with '.ib' suffix So that pos msgs from the ems are correctly loaded.. --- piker/brokers/ib/api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/piker/brokers/ib/api.py b/piker/brokers/ib/api.py index 7647d03e..bc4bdcf1 100644 --- a/piker/brokers/ib/api.py +++ b/piker/brokers/ib/api.py @@ -727,12 +727,16 @@ class Client: or tract.exchange or exch ) - pattern: str = f'{symbol}.{exch}' + pattern: str = f'{symbol}.{exch.lower()}' expiry: str = tract.lastTradeDateOrContractMonth # add an entry with expiry suffix if available if expiry: pattern += f'.{expiry}' + # since pos update msgs will always have the full fqme + # with suffix? + pattern += '.ib' + # directly cache the input pattern to the output # contract match as well as by the IB-internal conId. self._contracts[pattern] = tract