Update to new pair schema, adds `.cost_decimals` field
parent
887583d27f
commit
48ff4859e6
|
@ -61,6 +61,7 @@ class Pair(Struct):
|
||||||
quote: str # asset id of quote component
|
quote: str # asset id of quote component
|
||||||
lot: str # volume lot size
|
lot: str # volume lot size
|
||||||
|
|
||||||
|
cost_decimals: int
|
||||||
pair_decimals: int # scaling decimal places for pair
|
pair_decimals: int # scaling decimal places for pair
|
||||||
lot_decimals: int # scaling decimal places for volume
|
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
|
# transform to upper since piker style is always lower
|
||||||
sym = sym.upper()
|
sym = sym.upper()
|
||||||
|
sym_info = await client.symbol_info(sym)
|
||||||
si = Pair(**await client.symbol_info(sym)) # validation
|
si = Pair(**sym_info) # validation
|
||||||
syminfo = si.to_dict()
|
syminfo = si.to_dict()
|
||||||
syminfo['price_tick_size'] = 1 / 10**si.pair_decimals
|
syminfo['price_tick_size'] = 1 / 10**si.pair_decimals
|
||||||
syminfo['lot_tick_size'] = 1 / 10**si.lot_decimals
|
syminfo['lot_tick_size'] = 1 / 10**si.lot_decimals
|
||||||
|
|
Loading…
Reference in New Issue