Alpaca-API icon indicating copy to clipboard operation
Alpaca-API copied to clipboard

Migrate polygon integration from NATS to websocket cluster.

Open OUeasley opened this issue 6 years ago • 7 comments

Polygon has seemingly switched their real-time integrations from NATS to a websocker cluster [0]. We should probably switch this over for improved stability [1].

0 - websocket cluster docs 1 - deprecation notices on their github

Also adding an error messages that has been seen on the NATS cluster:

Exception in thread "Thread-0" java.io.IOException: Unable to connect to gnatsd server.
    at io.nats.client.impl.NatsConnection.connect(NatsConnection.java:185)
    at io.nats.client.impl.NatsImpl.createConnection(NatsImpl.java:28)
    at io.nats.client.Nats.createConnection(Nats.java:192)
    at io.nats.client.Nats.connect(Nats.java:147)

OUeasley avatar Jan 31 '19 14:01 OUeasley

Additionally, it looks like the API keys that work on the Polygon NATS servers, do not work with the Websocket servers.

thisiskj avatar Feb 03 '19 02:02 thisiskj

This is something that I believe requires some work on Polygon's side before it can be done. As was noted above, we cannot simply switch our SDKs to point to their websockets instead, as the keys are not authorized for websockets. We do intend to continue coordinating with Polygon and change the connection method over when we're able.

ttt733 avatar Feb 12 '19 23:02 ttt733

Is there a timeline on this +ttt733?

mtcliatt avatar Mar 23 '19 05:03 mtcliatt

I'd like to second @mtcliatt question. It can be a lot of wasted effort for users to develop against a service that has already been deprecated upstream.

d-e-s-o avatar May 09 '19 16:05 d-e-s-o

I saw in the latest Alpaca product update email (7/18/19), that there has been progress on migrating to use the Polygon.io WebSockets API. Is there a date when our API keys will work?

I have tried connecting to the API using the same key I used for the NATS connection but am receiving an "authentication failed" message.

➜  wscat --connect wss://socket.polygon.io/stocks

connected (press CTRL+C to quit)
< [{"ev":"status","status":"connected","message":"Connected Successfully"}]
> {"action":"auth","params":"******"}
< [{"ev":"status","status":"auth_failed","message":"authentication failed"}]

thisiskj avatar Jul 23 '19 11:07 thisiskj

The endpoint is wss://alpaca.socket.polygon.io/stocks and you should be able to connect using Alpaca API key today. We will document it soon officially.

umitanuki avatar Jul 24 '19 01:07 umitanuki

image Any idea on why this is happening???

boshng95 avatar Feb 14 '21 09:02 boshng95