Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AnMakc opened this issue May 21, 2024 · 1 comment
Open

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

AnMakc opened this issue May 21, 2024 · 1 comment

Comments

@AnMakc
Copy link

AnMakc commented May 21, 2024

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",
}
@AnMakc
Copy link
Author

AnMakc commented May 21, 2024

Note that attempt to place several orders one-by-one using POST /openApi/swap/v2/trade/order may also return "Please try again later;" message if requests are sent with no artificial delay.

@AnMakc AnMakc changed the title Bulk order in swap API only places one order Bulk order in swap API only places one order only May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant