Skip to content

Bulk order in swap API only places one order only #6

@AnMakc

Description

@AnMakc

When multiple orders are sent to the /openApi/swap/v2/trade/batchOrders Bulk order endpoint, only one of the orders is placed and non-informative error is returned for others.

For example, request with following orders

{
    "batchOrders": [
        {
            "symbol": "BTC-USDT",
            "side": "SELL",
            "positionSide": "BOTH",
            "type": "STOP_MARKET",
            "reduceOnly": true,
            "stopPrice": 65000,
            "quantity": 0.0004,
        },
        {
            "symbol": "BTC-USDT",
            "side": "SELL",
            "positionSide": "BOTH",
            "type": "TAKE_PROFIT_MARKET",
            "reduceOnly": true,
            "stopPrice": 75000,
            "quantity": 0.0002,
        },
        {
            "symbol": "BTC-USDT",
            "side": "SELL",
            "positionSide": "BOTH",
            "type": "TAKE_PROFIT_MARKET",
            "reduceOnly": true,
            "stopPrice": 80000,
            "quantity": 0.0002,
        },
    ]
}

Results in following response:

{
    "code": 80001,
    "data": {
        "orders": [
            {
                "orderId": 1778161388905664512,
                "positionSide": "BOTH",
                "quantity": 0.0004,
                "reduceOnly": true,
                "side": "SELL",
                "stopPrice": 65000,
                "symbol": "BTC-USDT",
                "type": "STOP_MARKET",
                "workingType": "MARK_PRICE",
                // Remaining fields for this order here
            }
        ]
    },
    "msg": "Please try again later; Please try again later",
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions