- WebSocket connections have a limit of 10 incoming messages per second.
Not all trading algorithms trade that little.
Which means to scale this up, one would need multiple socket connections?
How many sockets is one allowed to open?
Not all trading algorithms trade that little.
Which means to scale this up, one would need multiple socket connections?
How many sockets is one allowed to open?
There are two different WebSocket interfaces to the exchange:
ws-fapi.binance.com
) — primarily useful for order placementfstream.binance.com
) — useful for listening to market dataThe 10 messages per seconds limit applies to the second one, the market data streams. There you have independent limit on the number of subscription requests and such. Naturally, you cannot place orders through market data streams.
WebSocket API has separate rate limits, based on request weight used per IP address and number of orders placed per account. These limits are shared with REST API. You can learn the current limits via REST API, see https://fapi.binance.com/fapi/v1/exchangeInfo
request.
Currently, order placement requests consume zero weight, meaning they are constrained only by the order placement limits. The rate limits currently are:
{
"rateLimitType": "ORDERS",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 1200
},
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 300
}
meaning you can place at most 300 orders per 10 seconds, and at most 1200 orders per 1 minute. If you need more, you can create more subaccounts.