tastytrade / tastytrade-sdk-python

MIT License
49 stars 13 forks source link

unable to subscribe to market data due to likely invalid endpoint `/quote-streamer-tokens`. #20

Open pangyuteng opened 2 months ago

pangyuteng commented 2 months ago

Unable to subscribe to market data due to likely invalid endpoint /quote-streamer-tokens

version used was tastytrade-sdk==1.0.0

minimal reproducible example and error/traceback provided below.

import os
from tastytrade_sdk import Tastytrade
tasty = Tastytrade(api_base_url=api_url).login(login=username, password=password)
symbols = ['BTC/USD']
subscription = tasty.market_data.subscribe(
    symbols=symbols,
    on_quote=print,
    on_candle=print,
    on_greeks=print
)
![image](https://github.com/user-attachments/assets/09512ba8-cab1-4141-a9df-64117b4cd34f)

related issues provided below.

https://github.com/tastytrade/tastytrade-api-js/issues/7 https://github.com/tastyware/tastytrade/issues/142

pangyuteng commented 2 months ago

solution (for now) seems to be to replace GET /quote-streamer-tokens with GET /api-quote-tokens per https://github.com/tastytrade/tastytrade-api-js/issues/7#issuecomment-2050511655

in https://github.com/tastytrade/tastytrade-sdk-python/blob/master/src/tastytrade_sdk/market_data/market_data.py#L34

pangyuteng commented 2 months ago

proposed patch provided below:

update

--

evidence below showing proposed patch resolved the issue raised:

image

--

and now i'm on the same page with https://github.com/tastytrade/tastytrade-sdk-python/issues/17 :laughing: !