Woops, fix wss_url lookup depending on venue..

basic_buy_bot
Tyler Goodlet 2023-06-17 13:37:58 -04:00
parent a9c016ba10
commit 249d358737
1 changed files with 8 additions and 2 deletions

View File

@ -406,6 +406,7 @@ async def stream_quotes(
async with ( async with (
send_chan as send_chan, send_chan as send_chan,
open_cached_client('binance') as client,
): ):
init_msgs: list[FeedInit] = [] init_msgs: list[FeedInit] = []
for sym in symbols: for sym in symbols:
@ -416,10 +417,15 @@ async def stream_quotes(
FeedInit(mkt_info=mkt) FeedInit(mkt_info=mkt)
) )
wss_url: str = get_api_eps(client.mkt_mode)[1] # 2nd elem is wss url
# TODO: for sanity, but remove eventually Xp
if 'future' in mkt.type_key:
assert 'fstream' in wss_url
async with ( async with (
open_cached_client('binance') as client,
open_autorecon_ws( open_autorecon_ws(
url=get_api_eps(client.mkt_mode)[1], # 2nd elem is wss url url=wss_url,
fixture=partial( fixture=partial(
subscribe, subscribe,
symbols=[mkt.bs_mktid], symbols=[mkt.bs_mktid],