dougdellolio / coinbasepro-csharp

The unofficial .NET/C# client library for the Coinbase Pro/GDAX API
MIT License
192 stars 90 forks source link

clientOId doesn't seem to work #288

Closed prozerran closed 3 years ago

prozerran commented 3 years ago

Whats the purpose of clientOId in the methods...

PlaceMarketOrderAsync PlaceLimitOrderAsync PlaceStopOrderAsync

I would expect if i pass in a clientOId, after the order gets entered, the returned value would come back as OrderResponse Id. But that isnt the case, whatever i pass in for clientOId, i am getting a new (guid) OrderResponse Id (orderid)

dougdellolio commented 3 years ago

In summary, the client_oid field is different than the order response id in that it is broadcasted in the public feed for received messages through the websocket feed. This will allow you to identify your order in the public feed. The server will still assign you an order id to track any status updates.

From their docs under Client Order Id - (https://docs.pro.coinbase.com/#place-a-new-order):

CLIENT ORDER ID The optional client_oid field must be a UUID generated by your trading application. This field value will be broadcast in the public feed for received messages. You can use this field to identify your orders in the public feed.

The client_oid is different than the server-assigned order id. If you are consuming the public feed and see a received message with your client_oid, you should record the server-assigned order_id as it will be used for future order status updates. The client_oid will NOT be used after the received message is sent.

The server-assigned order id is also returned as the id field to this HTTP POST request.

You can also find an example of how this looks in the websocket feed here: https://github.com/dougdellolio/coinbasepro-csharp/issues/263#issuecomment-770410110

prozerran commented 3 years ago

fine. i'll close this.