From 48ff4859e664b74ce6a3d9495acc37dc4f2c574f Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 23 Sep 2022 15:23:37 -0400 Subject: [PATCH] Update to new pair schema, adds `.cost_decimals` field --- piker/brokers/kraken/feed.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/piker/brokers/kraken/feed.py b/piker/brokers/kraken/feed.py index e67d204c..6cc1cb7f 100644 --- a/piker/brokers/kraken/feed.py +++ b/piker/brokers/kraken/feed.py @@ -61,6 +61,7 @@ class Pair(Struct): quote: str # asset id of quote component lot: str # volume lot size + cost_decimals: int pair_decimals: int # scaling decimal places for pair lot_decimals: int # scaling decimal places for volume @@ -342,8 +343,8 @@ async def stream_quotes( # transform to upper since piker style is always lower sym = sym.upper() - - si = Pair(**await client.symbol_info(sym)) # validation + sym_info = await client.symbol_info(sym) + si = Pair(**sym_info) # validation syminfo = si.to_dict() syminfo['price_tick_size'] = 1 / 10**si.pair_decimals syminfo['lot_tick_size'] = 1 / 10**si.lot_decimals