Skip to content

Commit a3f8064

Browse files
author
Rostislav Lyupa
committed
improve comments
1 parent 3e5ad9a commit a3f8064

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

v2/futures/order_service.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,13 @@ func (s *ModifyOrderService) Symbol(symbol string) *ModifyOrderService {
255255
return s
256256
}
257257

258+
// OrderID will prevail over OrigClientOrderID
258259
func (s *ModifyOrderService) OrderID(orderID int64) *ModifyOrderService {
259260
s.orderID = &orderID
260261
return s
261262
}
262263

264+
// OrigClientOrderID is not necessary if OrderID is provided
263265
func (s *ModifyOrderService) OrigClientOrderID(origClientOrderID string) *ModifyOrderService {
264266
s.origClientOrderID = &origClientOrderID
265267
return s
@@ -320,7 +322,16 @@ func (s *ModifyOrderService) modifyOrder(ctx context.Context, endpoint string, o
320322
return data, header, nil
321323
}
322324

323-
// Do send request
325+
// Do send request:
326+
// - Either orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent
327+
// - Either price or priceMatch must be sent. Sending both will fail the request
328+
// - When the new quantity or price doesn't satisfy PriceFilter / PercentPriceFilter / LotSizeFilter,
329+
// amendment will be rejected and the order will stay as it is
330+
// - However the order will be cancelled by the amendment in the following situations:
331+
// -- when the order is in partially filled status and the new quantity <= executedQty
332+
// -- when the order is TimeInForceTypeGTX and the new price will cause it to be executed immediately
333+
// - One order can only be modified for less than 10000 times
334+
// - Will set ModifyOrderResponse.SelfTradePreventionMode to "NONE"
324335
func (s *ModifyOrderService) Do(ctx context.Context, opts ...RequestOption) (res *ModifyOrderResponse, err error) {
325336
data, _, err := s.modifyOrder(ctx, "/fapi/v1/order", opts...)
326337
if err != nil {

0 commit comments

Comments
 (0)