Update to new pair schema, adds `.cost_decimals` field

multi_client_order_mgt
Tyler Goodlet 2022-09-23 15:23:37 -04:00
parent 887583d27f
commit 48ff4859e6
1 changed files with 3 additions and 2 deletions

View File

@ -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