Bug in API for Margin OTOCO order?

Hi,

I’ve noticed few strange things regarding new OTOCO when using ‘STOP_LOSS’ for pending order. It look like values for price and stopPrice are switched, here is what I get as response:

{‘orderListId’: 3091954492, ‘contingencyType’: ‘OTO’, ‘listStatusType’: ‘EXEC_STARTED’, ‘listOrderStatus’: ‘EXECUTING’, ‘listClientOrderId’: ‘SELL_SHORT-1’, ‘transactionTime’: 1733282202136, ‘symbol’: ‘ETHUSDT’, ‘isIsolated’: False,
‘orders’:
[{‘symbol’: ‘ETHUSDT’, ‘orderId’: 22326387858, ‘clientOrderId’: ‘0jWLbMjlyJgIT8glDVEJV4’},
{‘symbol’: ‘ETHUSDT’, ‘orderId’: 22326387859, ‘clientOrderId’: ‘JtRdOstUNhSxbyBfAwPR2j’},
{‘symbol’: ‘ETHUSDT’, ‘orderId’: 22326387860, ‘clientOrderId’: ‘LvKS3ImakzxuSyXnfQMBq6’}],
‘orderReports’:
[{‘symbol’: ‘ETHUSDT’, ‘orderId’: 22326387858, ‘orderListId’: 3091954492, ‘clientOrderId’: ‘0jWLbMjlyJgIT8glDVEJV4’, ‘transactTime’: 1733282202136, ‘price’: ‘4000.00000000’, ‘origQty’: ‘0.02000000’, ‘executedQty’: ‘0’, ‘cummulativeQuoteQty’: ‘0’, ‘status’: ‘NEW’, ‘timeInForce’: ‘GTC’, ‘type’: ‘LIMIT’, ‘side’: ‘SELL’, ‘selfTradePreventionMode’: ‘EXPIRE_MAKER’},
{‘symbol’: ‘ETHUSDT’, ‘orderId’: 22326387859, ‘orderListId’: 3091954492, ‘clientOrderId’: ‘JtRdOstUNhSxbyBfAwPR2j’, ‘transactTime’: 1733282202136, ‘price’: ‘0E-8’, ‘origQty’: ‘0.02000000’, ‘executedQty’: ‘0’, ‘cummulativeQuoteQty’: ‘0’, ‘status’: ‘PENDING_NEW’, ‘timeInForce’: ‘GTC’, ‘type’: ‘STOP_LOSS’, ‘side’: ‘BUY’, ‘stopPrice’: ‘4100.00000000’, ‘selfTradePreventionMode’: ‘EXPIRE_MAKER’},
{‘symbol’: ‘ETHUSDT’, ‘orderId’: 22326387860, ‘orderListId’: 3091954492, ‘clientOrderId’: ‘LvKS3ImakzxuSyXnfQMBq6’, ‘transactTime’: 1733282202136, ‘price’: ‘3000.00000000’, ‘origQty’: ‘0.02000000’, ‘executedQty’: ‘0’, ‘cummulativeQuoteQty’: ‘0’, ‘status’: ‘PENDING_NEW’, ‘timeInForce’: ‘GTC’, ‘type’: ‘LIMIT_MAKER’, ‘side’: ‘BUY’, ‘selfTradePreventionMode’: ‘EXPIRE_MAKER’}]}

Is it a bug or I have done something wrong?

Why do you think the prices are switched?

The pending order looks expected to me. It’s on the BUY side, meaning STOP_LOSS should have higher price than the other order (LIMIT_MAKER) in this case: 4100 for stop loss vs. 3000 for limit order.

The STOP_LOSS itself does not have "price" as it is a contingent market order. The field is always present but set to zero, you should ignore it. There is a "stopPrice" which is when the stop loss order will trigger, should the trading price get that high. The STOP_LOSS does not specify the price, since you get the market price whatever it is.

The LIMIT_MAKER order does have a "price", which is the maximum price you’d be willing to pay when buying.

If you’d like to add a limit on the price to STOP_LOSS, there is STOP_LOSS_LIMIT order type that allows to specify a limit price.