Don't filter out clearing ticks XD
parent
2dc8ee2b4e
commit
e035af2f42
|
@ -737,9 +737,9 @@ async def stream_messages(
|
||||||
# decode/encode, see:
|
# decode/encode, see:
|
||||||
# https://jcristharif.com/msgspec/structs.html#type-validation
|
# https://jcristharif.com/msgspec/structs.html#type-validation
|
||||||
msg = AggTrade(**msg) # TODO: should we .copy() ?
|
msg = AggTrade(**msg) # TODO: should we .copy() ?
|
||||||
yield 'trade', {
|
piker_quote: dict = {
|
||||||
'symbol': msg.s,
|
'symbol': msg.s,
|
||||||
'last': msg.p,
|
'last': float(msg.p),
|
||||||
'brokerd_ts': time.time(),
|
'brokerd_ts': time.time(),
|
||||||
'ticks': [{
|
'ticks': [{
|
||||||
'type': 'trade',
|
'type': 'trade',
|
||||||
|
@ -748,6 +748,7 @@ async def stream_messages(
|
||||||
'broker_ts': msg.T,
|
'broker_ts': msg.T,
|
||||||
}],
|
}],
|
||||||
}
|
}
|
||||||
|
yield 'trade', piker_quote
|
||||||
|
|
||||||
|
|
||||||
def make_sub(pairs: list[str], sub_name: str, uid: int) -> dict[str, str]:
|
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')
|
# hz = 1/period if period else float('inf')
|
||||||
# if hz > 60:
|
# if hz > 60:
|
||||||
# log.info(f'Binance quotez : {hz}')
|
# log.info(f'Binance quotez : {hz}')
|
||||||
|
topic = msg['symbol'].lower()
|
||||||
if typ == 'l1':
|
await send_chan.send({topic: msg})
|
||||||
topic = msg['symbol'].lower()
|
|
||||||
await send_chan.send({topic: msg})
|
|
||||||
# last = time.time()
|
# last = time.time()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue