Skip to content

Commit

Permalink
Add warning msg for openOrders.userref always being 0
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Jul 30, 2022
1 parent d43ba47 commit e6a3e8b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions piker/brokers/kraken/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ async def handle_order_requests(
'event': ep,
'token': token,

# XXX: this seems to always get an error response?
# 'userref': f"'{reqid}'",

'reqid': reqid, # remapped-to-int uid from ems
'pair': pair,
'price': str(order.price),
Expand Down Expand Up @@ -711,8 +714,7 @@ async def handle_order_updates(
continue

case {
# XXX: lol, ws bug, this is always 0!
'userref': _,
'userref': reqid,

# during a fill this field is **not**
# provided! but, it is always avail on
Expand Down Expand Up @@ -764,7 +766,15 @@ async def handle_order_updates(
else:
vlm = rest.get('vol_exec', 0)

reqid = reqids2txids.inverse.get(txid)
ourreqid = reqids2txids.inverse.get(txid)

if ourreqid != reqid:
log.warning(
'REQID MISMATCH due to kraken api bugs..\n'
f'msg:{reqid}, ours:{ourreqid}'
)
reqid = ourreqid

oid = ids.inverse.get(reqid)

if (
Expand Down

0 comments on commit e6a3e8b

Please sign in to comment.