Send fill msg first

notokeninwswrapper
Tyler Goodlet 2022-07-03 11:19:33 -04:00
parent aea7bec2c3
commit 4c0f2099aa
1 changed files with 15 additions and 16 deletions

View File

@ -385,6 +385,21 @@ async def trades_dialogue(
size = float(msg['vol'])
broker_time = float(msg['time'])
# send a fill msg for gui update
fill_msg = BrokerdFill(
reqid=reqid,
time_ns=time.time_ns(),
action=action,
size=size,
price=price,
# TODO: maybe capture more msg data
# i.e fees?
broker_details={'name': 'kraken'},
broker_time=broker_time
)
await ems_stream.send(fill_msg.dict())
filled_msg = BrokerdStatus(
reqid=reqid,
time_ns=time.time_ns(),
@ -409,22 +424,6 @@ async def trades_dialogue(
)
await ems_stream.send(filled_msg.dict())
# send a fill msg for gui update
fill_msg = BrokerdFill(
reqid=reqid,
time_ns=time.time_ns(),
action=action,
size=size,
price=price,
# TODO: maybe capture more msg data
# i.e fees?
broker_details={'name': 'kraken'},
broker_time=broker_time
)
await ems_stream.send(fill_msg.dict())
case _:
log.warning(f'Unhandled trades msg: {msg}')
await tractor.breakpoint()