From e035af2f42516fd238d54cfed9ccfbbd956c8331 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 9 Jun 2023 16:14:42 -0400 Subject: [PATCH] Don't filter out clearing ticks XD --- piker/brokers/binance.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/piker/brokers/binance.py b/piker/brokers/binance.py index 3bbea328..9eb6732f 100644 --- a/piker/brokers/binance.py +++ b/piker/brokers/binance.py @@ -737,9 +737,9 @@ async def stream_messages( # decode/encode, see: # https://jcristharif.com/msgspec/structs.html#type-validation msg = AggTrade(**msg) # TODO: should we .copy() ? - yield 'trade', { + piker_quote: dict = { 'symbol': msg.s, - 'last': msg.p, + 'last': float(msg.p), 'brokerd_ts': time.time(), 'ticks': [{ 'type': 'trade', @@ -748,6 +748,7 @@ async def stream_messages( 'broker_ts': msg.T, }], } + yield 'trade', piker_quote def make_sub(pairs: list[str], sub_name: str, uid: int) -> dict[str, str]: @@ -948,10 +949,8 @@ async def stream_quotes( # hz = 1/period if period else float('inf') # if hz > 60: # log.info(f'Binance quotez : {hz}') - - if typ == 'l1': - topic = msg['symbol'].lower() - await send_chan.send({topic: msg}) + topic = msg['symbol'].lower() + await send_chan.send({topic: msg}) # last = time.time()