From efd52e8ce3b3cd151b4478755483b184c5aca3fd Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 24 Jun 2023 17:23:10 -0400 Subject: [PATCH] kraken: always insert ticks `list`, only append if vlm --- piker/brokers/kraken/feed.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/piker/brokers/kraken/feed.py b/piker/brokers/kraken/feed.py index 26956a1c..d0b14f33 100644 --- a/piker/brokers/kraken/feed.py +++ b/piker/brokers/kraken/feed.py @@ -24,7 +24,6 @@ from contextlib import ( ) from datetime import datetime from typing import ( - Any, AsyncGenerator, Callable, Optional, @@ -460,12 +459,16 @@ async def stream_quotes( last = quote.close quote = normalize(quote) + ticks = quote.setdefault( + 'ticks', + [], + ) if tick_volume: - quote['ticks'] = [{ + ticks.append({ 'type': 'trade', 'price': last, 'size': tick_volume, - }] + }) case 'l1': # passthrough quote msg