tastytrade / tastytrade-api-js

Javascript sdk for the tastytrade api
MIT License
67 stars 36 forks source link

Different events using API and the tasty app #5

Closed OperationalFallacy closed 11 months ago

OperationalFallacy commented 11 months ago

I want to subscribe to market data on options symbols and get the latest events, even when markets are closed. I'm looking for a snapshot of data rather than a real-time stream.

The tasty platform always shows the latest Greeks, quotes, etc, for the option symbols.

Looking at wss://tasty-demo-ws.dxfeed.com/delayed events in the browser, I see the usual FEED_DATA even when the options market is closed.

{"type":"FEED_DATA","channel":1,"data":["Greeks",["Greeks",".PLTR231117C15",0.859042135169914,0.679454583347139,0.0982083687887286,-0.0261660721057656,0.00609448239509639,0.01518018285523352,"Greeks",".WBA231117P27.5",0.74595897321041,-0.851562819473887,0.0539648651528887,-0.01993263273054975,-0.0167382063515774,0.01331688462849462]]}    1698104164.7325706

The API client behaves differently:

this.streamer.addSubscription( '.PLTR231117C15', {subscriptionTypes: [MarketDataSubscriptionType.Trade], channelId: 1}) would not produce any data

this.streamer.addSubscription( 'AAPL', {subscriptionTypes: [MarketDataSubscriptionType.Quote], channelId: 1}) shows data arriving

I couldn't find anything obvious in the API client implementation that may prevent receiving data outside of the window for opened markets.

dmoss18 commented 11 months ago

Hi @OperationalFallacy The api quote token has different entitlements than the platform quote tokens. Currently the api quote token is only entitled to equity quotes. We are working on adding equity options and other instrument types. Please note that using the api to fetch a platform quote token is a violation of our api terms and conditions, so be careful when testing so that you don't get put on delayed quotes.

OperationalFallacy commented 11 months ago

Thank you, I figured the difference. I'll continue development and testing with a delayed stream/quotes for now.

josebalius commented 11 months ago

@dmoss18 So I'm I understanding correctly that at the moment we can't use the streamer token the API gives us to stream futures options data?

dmoss18 commented 11 months ago

@josebalius That's correct. Just equities quotes at this time.

josebalius commented 11 months ago

Is there anywhere I can subscribe (maybe an issue or something) to know when this is available? This is a blocker for me :/

dmoss18 commented 11 months ago

@josebalius I can open an issue here and you can subscribe to notifications. I'll come back with updates when equity options and other instrument quotes are added.

josebalius commented 11 months ago

Thank you! ❤

dmoss18 commented 11 months ago

@josebalius Here is the issue https://github.com/tastytrade/tastytrade-api-js/issues/7.

dirkdirk commented 8 months ago

@OperationalFallacy From where are you streaming delayed data?