coinbase-pro-node icon indicating copy to clipboard operation
coinbase-pro-node copied to clipboard

getting instant order updates

Open adityamertia opened this issue 8 years ago • 2 comments

Is there a way to set a handle on an order such that every update for the order is sent automatically. 2 ways to achieve this are to place the order and

  1. using the orderId to either check status using API
  2. using orderId to filter the websocket data to find status updates on orderId. The first approach will be too slow for getting status updates and also isn't the recommended approach for status updates (API do block) In the second approach, there can be chances that the WebSocket data is missed due to delay in starting websocket read.

Is there an alternate preferred way of doing this?

adityamertia avatar Jul 30 '18 19:07 adityamertia

If you have an id saved somewhere then you probably submitted the order some time ago. So, if you connect to the websocket then there is a chance that you will not receive updates because your order is settled already. But if you connect to the websocket and after that you submit your order then you will get all updates on ws channel. It seems that the preferred way is to get order updates using REST requests and connect to the websocket to start listening for new updates. If the websocket connection is closed then you just reconnect (and probably make another REST request if you can't reconnect immediately ).

vansergen avatar Oct 01 '18 17:10 vansergen

Hi, we are closing out PRs + Issues as this project is being archived.

drewrothstein avatar Jan 16 '20 05:01 drewrothstein