Bleh `kraken`, fix another ref error in fill block

Clearly, the linter didn't help us here.. but, just pass the
`brokerd` time for now in the `.broker_time` field; we can't get it from
the fill-case incremental updates in the `openOrders` sub. Add some
notes about this and how we might approach for backends with this
limitation.
kraken_fill_bugs
Tyler Goodlet 2022-09-12 13:24:23 -04:00
parent c724117c1a
commit 0aef762d9a
2 changed files with 14 additions and 2 deletions

View File

@ -1024,7 +1024,7 @@ async def handle_order_updates(
# TODO: maybe capture more msg data
# i.e fees?
broker_details={'name': 'kraken'} | order_msg,
broker_time=broker_time
broker_time=time.time(),
)
await ems_stream.send(fill_msg)

View File

@ -985,7 +985,19 @@ async def process_trade_msg(
pointing='up' if action == 'buy' else 'down',
# TODO: put the actual exchange timestamp
arrow_index=get_index(details['broker_time']),
arrow_index=get_index(
# TODO: note currently the ``kraken`` openOrders sub
# doesn't deliver their engine timestamp as part of
# it's schema, so this value is **not** from them
# (see our backend code). We should probably either
# include all provider-engine timestamps in the
# summary 'closed' status msg and/or figure out
# a way to indicate what is a `brokerd` stamp versus
# a true backend one? This will require finagling
# with how each backend tracks/summarizes time
# stamps for the downstream API.
details['broker_time']
),
)
# TODO: how should we look this up?