Skip to content

Commit

Permalink
Merge pull request #357 from pikers/paper_eng_msg_fixes
Browse files Browse the repository at this point in the history
Oof, paper engine msg fixes after using `msgspec.Struct`..
  • Loading branch information
goodboy authored Jul 11, 2022
2 parents 37f634a + fd22f45 commit f449672
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions piker/clearing/_paper_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ async def submit_limit(
msg = BrokerdStatus(
status='submitted',
reqid=reqid,
broker=self.broker,
time_ns=time.time_ns(),
filled=0.0,
reason='paper_trigger',
remaining=size,

broker_details={'name': 'paperboi'},
)
await self.ems_trades_stream.send(msg)

Expand Down Expand Up @@ -168,10 +169,9 @@ async def submit_cancel(

msg = BrokerdStatus(
status='cancelled',
oid=oid,
reqid=reqid,
broker=self.broker,
time_ns=time.time_ns(),
broker_details={'name': 'paperboi'},
)
await self.ems_trades_stream.send(msg)

Expand Down Expand Up @@ -229,14 +229,13 @@ async def fake_fill(
filled=size,
remaining=0 if order_complete else remaining,

action=action,
size=size,
price=price,

broker_details={
'paper_info': {
'oid': oid,
},
'action': action,
'size': size,
'price': price,
'name': self.broker,
},
)
Expand Down

0 comments on commit f449672

Please sign in to comment.