stream_quotes now using FeedInit

jsonrpc_err_in_rent_task
Nelson Torres 2024-11-08 21:57:35 +00:00
parent 1f4a5b80c4
commit ea6126d310
1 changed files with 6 additions and 17 deletions

View File

@ -34,7 +34,6 @@ from rapidfuzz import process as fuzzy
import numpy as np import numpy as np
import tractor import tractor
from piker.accounting import MktPair
from piker.accounting import ( from piker.accounting import (
MktPair, MktPair,
unpack_fqme, unpack_fqme,
@ -213,29 +212,19 @@ async def stream_quotes(
sym = symbols[0] sym = symbols[0]
#init_msgs: list[FeedInit] = [] init_msgs: list[FeedInit] = []
async with ( async with (
open_cached_client('deribit') as client, open_cached_client('deribit') as client,
send_chan as send_chan send_chan as send_chan
): ):
init_msgs = { mkt, pair = await get_mkt_info(sym)
# 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,
},
}
# build out init msgs according to latest spec
init_msgs.append(
FeedInit(mkt_info=mkt)
)
nsym = piker_sym_to_cb_sym(sym.split('.')[0]) nsym = piker_sym_to_cb_sym(sym.split('.')[0])
async with maybe_open_price_feed(sym) as stream: async with maybe_open_price_feed(sym) as stream: