From ea6126d3104fc0da37274d4dcc85c0c0522f0c98 Mon Sep 17 00:00:00 2001 From: Nelson Torres Date: Fri, 8 Nov 2024 21:57:35 +0000 Subject: [PATCH] stream_quotes now using FeedInit --- piker/brokers/deribit/feed.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/piker/brokers/deribit/feed.py b/piker/brokers/deribit/feed.py index bb5a0155..9cea38ee 100644 --- a/piker/brokers/deribit/feed.py +++ b/piker/brokers/deribit/feed.py @@ -34,7 +34,6 @@ from rapidfuzz import process as fuzzy import numpy as np import tractor -from piker.accounting import MktPair from piker.accounting import ( MktPair, unpack_fqme, @@ -213,29 +212,19 @@ async def stream_quotes( sym = symbols[0] - #init_msgs: list[FeedInit] = [] + init_msgs: list[FeedInit] = [] async with ( open_cached_client('deribit') as client, send_chan as send_chan ): - init_msgs = { - # pass back token, and bool, signalling if we're the writer - # and that history has been written - sym: { - 'symbol_info': { - 'asset_type': 'option', - 'price_tick_size': 0.0005 - }, - 'shm_write_opts': { - 'sum_tick_vml': True, - 'has_vlm': True - }, - 'fqsn': sym, - }, - } + mkt, pair = await get_mkt_info(sym) + # build out init msgs according to latest spec + init_msgs.append( + FeedInit(mkt_info=mkt) + ) nsym = piker_sym_to_cb_sym(sym.split('.')[0]) async with maybe_open_price_feed(sym) as stream: