The task is as follows: There is a list of users from Binance exchange, each user can create an order on the Binance exchange. It is necessary to implement a mechanism for tracking user orders on the Binance exchange through a single connection. There are a lot of users. A lot of tokens and secret keys. One connection. I use the node js library "binance-api-node". But I am ready to hear any solutions to the problem.
1 Answers
Orders sent through the POST /api/v3/order endpoint (client.order() in the library) return a unique newClientOrderId
(or you can specify your own and send it with the request payload). You can store it in your app in relation with the order and the user.
Orders that have been created using a different way (e.g. the Binance UI) are a little more complicated. You can receive the list of orders per API key, for example with the GET /api/v3/allOrders endpoint. Each order again contains a unique clientOrderId
, and since you know the API key that you used to query these orders, you can make a relation between the clientOrderId
and your user.
Note that each Binance account can have multiple API keys and there is no easy way to determine whether two API keys belong to the same Binance account or not. See this answer for more info.
Because each authenticated REST endpoint requires exactly one API key (and some endpoints also require exactly one corresponding secret key to sign the payload), it is not possible to communicate with the API on behalf of multiple API keys in a single connection.
You'll need to make a separate request for each of the API keys.

- 40,554
- 8
- 72
- 100