Skip to content

Add support for OCO orders #59

Open

Description

@yashptel

This is supported via WEB UI. Why not via the API? Is it just the binance clone? Because Binance also has the same issue...

https://www.asterdex.com/bapi/futures/v3/private/future/strategy/place-order

{

    "strategyType": "OTOCO",
    "subOrderList": [
        {
            "symbol": "BTCUSDT",
            "strategySubId": 1,
            "firstDrivenId": 0,
            "secondDrivenId": 0,
            "side": "BUY",
            "positionSide": "BOTH",
            "type": "LIMIT",
            "quantity": "0.002",
            "securityType": "USDT_FUTURES",
            "reduceOnly": false,
            "timeInForce": "GTC",
            "price": "80000"
        },
        {
            "symbol": "BTCUSDT",
            "side": "SELL",
            "positionSide": "BOTH",
            "securityType": "USDT_FUTURES",
            "firstTrigger": "PLACE_ORDER",
            "firstDrivenOn": "PARTIALLY_FILLED_OR_FILLED",
            "secondDrivenOn": "PARTIALLY_FILLED_OR_FILLED",
            "secondTrigger": "CANCEL_ORDER",
            "timeInForce": "GTE_GTC",
            "reduceOnly": true,
            "quantity": "0.002",
            "strategySubId": 2,
            "firstDrivenId": 1,
            "secondDrivenId": 3,
            "stopPrice": "81000",
            "workingType": "MARK_PRICE",
            "type": "TAKE_PROFIT_MARKET",
            "priceProtect": true
        },
        {
            "symbol": "BTCUSDT",
            "side": "SELL",
            "positionSide": "BOTH",
            "securityType": "USDT_FUTURES",
            "firstTrigger": "PLACE_ORDER",
            "firstDrivenOn": "PARTIALLY_FILLED_OR_FILLED",
            "secondDrivenOn": "PARTIALLY_FILLED_OR_FILLED",
            "secondTrigger": "CANCEL_ORDER",
            "timeInForce": "GTE_GTC",
            "reduceOnly": true,
            "quantity": "0.002",
            "strategySubId": 3,
            "firstDrivenId": 1,
            "secondDrivenId": 2,
            "stopPrice": "79000",
            "workingType": "CONTRACT_PRICE",
            "type": "STOP_MARKET",
            "priceProtect": true
        }
    ],
    "signer": "***",
    "user": "***",
    "nonce": 1766483142103700,
    "signature": "****"
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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