binance / binance-connector-node

A simple connector to Binance Public API
MIT License
553 stars 160 forks source link

Receiving ping/pong but no orders coming in (websocket / userdata API) #135

Closed DutchKevv closed 11 months ago

DutchKevv commented 1 year ago

Hi there,

Since a while the websocket becomes 'unresponsive' after a few hours, but it doesn't disconnect... There is just no new orders coming in.

I tried multiple things:

manually send the ping every minute, and I keep receiving pongs back, but no new orders.

renew the listen key every half hour.. Works for a few hours, then orders just stop coming in.

changed npm packages. . Tried multiple NPM packages (thought maybe it was a bug).. Same problem.

tried openening a single tick listener over the same websocket, to maybe keep the connection open because a solid stream of ticks is coming in.. Same problem.

tried multiple machines on multiple internet connections, same problem.

I have 2 servers. 1 for syncing candle non stop, and 1 for the trading bots.

I tried giving both servers a separate API key, same problem.

Its driving me crazy!

Anyone has got some tips?? Thanks!

dowebdevelopment commented 1 year ago

+1

2pd commented 11 months ago

You have to manually renew the listen key every 60 mins.

A User Data Stream listenKey is valid for 60 minutes after creation.

https://github.com/binance/binance-spot-api-docs/blob/master/user-data-stream.md