Binance Margin Trading: Inconsistent behaviour of STOP_LOSS order type

Hello Binance developers,

I think I found a bug. Here is a video: Imgur: The magic of the Internet

When I try to open a STOP_LOSS_LIMIT order where the limit price is more than 15% away from the index price, I get the following error:

-3064: Limit price needs to be within (-15%,15%) of current index price for this margin trading pair. This rule only impact limit sell price lower than index price and limit buy price higher than index price.

Ok, that sucks (and this wasn’t always the case, a year ago this was possible), but I’ll just open a STOP_LOSS (market) order. Here, using a stop price, that is for example 25% away from the index price, works, error -3064 is not returned. When I do the same in an OCO (or OTOCO), it doesn’t work, error -3064 is returned.

Can someone please explain this behaviour to me? Is it a bug? Is there any other workaround so I can create a stoploss 30% from the index price?

Thanks!

I now got it working through the UI (using the TP/SL checkbox). But still no success using the API, so I’m 99% sure this is unwanted behaviour.

This is my api request:

        val endpoint = "/sapi/v1/margin/order/otoco"
        val parameters = mutableMapOf(
            "symbol" to "OMUSDT",
            "isIsolated" to "FALSE",
            "sideEffectType" to "MARGIN_BUY",
            //working
            "workingType" to "LIMIT",
            "workingSide" to "SELL",
            "workingPrice" to "6.2",
            "workingQuantity" to "2",
            "workingTimeInForce" to "GTC",
            //pending
            "pendingSide" to "BUY",
            "pendingQuantity" to "2",
            //sl
            "pendingAboveType" to "STOP_LOSS",
            "pendingAboveStopPrice" to "9",
            //tp
            "pendingBelowType" to "LIMIT_MAKER",
            "pendingBelowPrice" to "3"
        )

This is the fetch request from the UI:

fetch("https://www.binance.com/bapi/margin/v1/private/margin/place-order", {
  ...
  "body": "{\"side\":\"SELL\",\"symbol\":\"OMUSDT\",\"quantity\":\"2\",\"price\":\"6.2\",\"type\":\"LIMIT\",\"timeInForce\":\"GTC\",\"stopType\":\"MARKET\",\"sideEffectType\":\"MARGIN_BUY\",\"spOrderType\":\"OTO\",\"tpLimitPrice\":\"3\",\"stopPrice\":\"9\",\"stopLimitPrice\":\"\"}",
  "method": "POST",
  ...
});

And this is part of the response from the UI:

            "orders": [
                {
                    "symbol": "OMUSDT",
                    "orderId": "***",
                    "clientOrderId": "***"
                },
                {
                    "symbol": "OMUSDT",
                    "orderId": "***",
                    "clientOrderId": "***"
                },
                {
                    "symbol": "OMUSDT",
                    "orderId": "***",
                    "clientOrderId": "***"
                }
            ],
            "orderReports": [
                {
                    "symbol": "OMUSDT",
                    "orderId": "***",
                    "orderListId": "***",
                    "clientOrderId": "***",
                    "transactTime": "1738952990995",
                    "price": "6.20000000",
                    "origQty": "2.00000000",
                    "executedQty": "0.00000000",
                    "cummulativeQuoteQty": "0.00000000",
                    "status": "NEW",
                    "timeInForce": "GTC",
                    "type": "LIMIT",
                    "side": "SELL",
                    "stopPrice": null,
                    "selfTradePreventionMode": "EXPIRE_MAKER",
                    "workingTime": "1738952990995"
                },
                {
                    "symbol": "OMUSDT",
                    "orderId": "***",
                    "orderListId": "***",
                    "clientOrderId": "***",
                    "transactTime": "1738952990995",
                    "price": "0.00000000",
                    "origQty": "2.00000000",
                    "executedQty": "0.00000000",
                    "cummulativeQuoteQty": "0.00000000",
                    "status": "PENDING_NEW",
                    "timeInForce": "GTC",
                    "type": "STOP_LOSS",
                    "side": "BUY",
                    "stopPrice": "9.00000000",
                    "selfTradePreventionMode": "EXPIRE_MAKER",
                    "workingTime": "-1"
                },
                {
                    "symbol": "OMUSDT",
                    "orderId": "***",
                    "orderListId": "***",
                    "clientOrderId": "***",
                    "transactTime": "1738952990995",
                    "price": "3.00000000",
                    "origQty": "2.00000000",
                    "executedQty": "0.00000000",
                    "cummulativeQuoteQty": "0.00000000",
                    "status": "PENDING_NEW",
                    "timeInForce": "GTC",
                    "type": "LIMIT_MAKER",
                    "side": "BUY",
                    "stopPrice": null,
                    "selfTradePreventionMode": "EXPIRE_MAKER",
                    "workingTime": "-1"
                }
            ]

Judging from the order reports, my api call should be correct, no?

Is there a place where we can report bugs?

Hi, but in your video it says “Limit sell price” not “stop price” which you used in STOP_LOSS (market) order.