From d3192bb8c284980ddf1522e894d4a01df70ff644 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 8 Mar 2023 09:06:50 -0500 Subject: [PATCH 1/2] Read `Symbol` tick precision fields when no entry in `.broker_info` --- piker/pp.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/piker/pp.py b/piker/pp.py index 38ff1566..a01bdc4e 100644 --- a/piker/pp.py +++ b/piker/pp.py @@ -199,8 +199,16 @@ class Position(Struct): sym_info = s.broker_info[broker] d['asset_type'] = sym_info['asset_type'] - d['price_tick_size'] = sym_info['price_tick_size'] - d['lot_tick_size'] = sym_info['lot_tick_size'] + d['price_tick_size'] = ( + sym_info.get('price_tick_size') + or + s.tick_size + ) + d['lot_tick_size'] = ( + sym_info.get('lot_tick_size') + or + s.lot_tick_size + ) if self.expiry is None: d.pop('expiry', None) From aba238e8b1f9533c8085fb2649cd09d49c4e1cbc Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 8 Mar 2023 17:22:13 -0500 Subject: [PATCH 2/2] `kraken`: expect `Pair` in search results.. --- piker/brokers/kraken/feed.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/piker/brokers/kraken/feed.py b/piker/brokers/kraken/feed.py index b4a2e666..a737aaad 100644 --- a/piker/brokers/kraken/feed.py +++ b/piker/brokers/kraken/feed.py @@ -453,7 +453,7 @@ async def open_symbol_search( score_cutoff=50, ) # repack in dict form - await stream.send( - {item[0]['altname']: item[0] - for item in matches} - ) + await stream.send({ + pair[0].altname: pair[0] + for pair in matches + })