PUBLISH Modify Order

PUB wss://test-api.synquote.com/ws

Modifies an open limit order.

The order will lose its queue position, and will be assigned a new order_id.

This is a combined cancel+add operation and no other matching engine action can be executed by any other market participants during this action.

The status and cancel_reason fields are outlined here

REQUEST

HEADER PARAMS
msg_type string required
Message type: add_order
id number required
The ID of the request. This is returned in the response header.
version integer required
Version number: 1
##### BODY PARAMS
account_id string required
Account address which is placing the order.
order_id string required
The order that will be replaced by this modify request.
instrument_id string required
The instrument to buy or sell.
size string required
Size of position to trade in the underlying asset.
side string required
Can be buy or sell.
order_type string required
Can be limit, market, take_profit, or stop.
time_in_force string required
Can be one of gtc (Good till cancelled), gte (Good till expiration), ioc (Immediate or cancel), or fok (Fill-or-Kill).
execution_type string required
Can be post_only or allow_cross. post_only is only supported for limit orders.
signature string required
Signed order fields which are submitted to smart contracts for processing.
client_order_id string
ID assigned to the order by the client. This must be unique per-account. Will be set automatically to the exchange’s unique order_id if absent.
limit_price string
Limit price for the order. If this field is absent, null, or zero for take_profit and stop orders, the order will execute at market once the trigger_price is reached. This field must be absent, null or zero for market orders.
expiration number
Time that order will explicitly be canceled, in UNIX epoch seconds. For orders which do not have time-in-force gte, this field must be absent or explicitly set to null or zero.
nonce string required
Used to make orders with otherwise identical signed fields unique. See nonce section in glossary for specific requirements.
reduce_only boolean
true if the modification will only occur if it reduces the size.
trigger_price string
The reference price at which the order will become active. Required for take_profit and stop orders. Ignored for other order types.
Example
[
  {
    "msg_type":"add_order",
    "id": 1002,
    "version": 1
  },
  {
    "account_id":"0x9f58498b98348b9BFbE53F0E18AA818a4Be0aE49",
    "instrument_id": "ETH-PERPETUAL",
    "size": "1",
    "size": "buy",
    "order_type": "limit",
    "time_in_force": "gtc",
    "execution_type": "allow_cross",
    "limit_price": "4000",
    "expiration": 0,
    "nonce": "7433990883764493008",
    "signature": "0xf86ea8c7f9a8e93f91b292b1e6ff3e0bb9b12f3aeb9ed32f3450fbbf1a2a5d181b7aef913589aa45d6d0bdf5c3085f8a3103a1e2fa1572bf12a55a8d7408df631c",
    "reduce_only": false
  }
]

RESPONSE

add_order_response object
account_id string
The account address which placed the order.
transaction_ts string
The time the order was received by the system in UNIX epoch nanoseconds.
avg_execution_price string
The average execution price of the fills, if any.
client_order_id string
The client-assigned order ID. Set automatically to order_id if absent.
execution_type string
The execution type of the order. Can be post_only or allow_cross.
expiration string
The expiration time of the order in UNIX epoch seconds.
fills array of objects
transaction_ts string
The time the fill occurred in UNIX epoch nanoseconds.
fill_price string
The price of the fill.
fill_size string
The size of the fill.
fill_total_fee string
The total fee of the fill.
is_maker boolean
Whether the fill was a maker order.
is_liquidation boolean
Whether the fill is a liquidation.
trade_pnl string
The pnl of the fill.
market_seqno string
The market sequence number of the fill. A monotonic sequence number updated for each book event. e.g. a fill, cancel, etc.
trade_id string
The unique ID of the trade.
initial_size string
The initial size of the order.
instrument_id string
The instrument of the order.
limit_price string
The limit price of the order.
status string
The status of the order.
nonce string
Used to make orders with otherwise identical signed fields unique.
order_id string
The unique ID of the order.
order_type string
Can be limit, market, take_profit, or stop.
remaining_size string
The remaining unfilled portion of the order.
side string
The side of the order.
signature string
Signed order fields which are submitted to smart contracts for processing.
time_in_force string
The time in force of the order. Can be gtc, gte, ioc, or fok.
total_fill_size string
The total size of the fills.
cancel_reason string
Only included if status is a cancel
reduce_only boolean
Whether the order was reduce_only.
trigger_price string
The trigger price of the order. Only present for take_profit and stop orders.
market_seqno string
The market sequence number of the new order. A monotonic sequence number updated for each book event. e.g. a fill, cancel, etc.
prev_order_type string
The original order type before it was triggered into a new state. This field will differ from order_type if the order transitioned to a different type upon triggering a condition (e.g., a stop order converting to a market order). If no such transition occurred, this field will match order_type.
cancel_order_response object
client_order_id string
The client order ID of the canceled order.
order_id string
The unique ID of the order.
status string
The status of the cancellation. Can be canceled or order_not_found.
market_seqno string
The market sequence number of the cancel. A monotonic sequence number updated for each book event. e.g. a fill, cancel, etc.
transaction_ts string
The time the order was canceled by the system in UNIX epoch nanoseconds.
size string
The size of the order that was canceled.
Example
[
  {
    "msg_type":"add_order_response",
    "id": 1002,
    "version": 1
  },
  {
     "add_order_response": {
        "account_id": "0x9f58498b98348b9bfbe53f0e18aa818a4be0ae49",
        "transaction_ts": "1714441870685341751",
        "avg_execution_price": "3207.60",
        "client_order_id": "8524676410238383080",
        "execution_type": "allow_cross",
        "expiration": "1723081870",
        "fills": [
            {
                "transaction_ts": "1714441870686868798",
                "fill_price": "3207.6",
                "fill_size": "63.98",
                "fill_total_fee": "1.25",
                "is_maker": false,
                "is_liquidation": false,
                "trade_pnl": "20.01",
              	"market_seqno": 123458,
              	"trade_id": "11416748077714502636"
            }
        ],
        "initial_size": "63.98",
        "instrument_id": "ETH-PERPETUAL",
        "limit_price": "3208.87",
        "status": "full_fill",
        "nonce": "7433990883764493008",
        "order_id": "8524676410238383080",
        "order_type": "limit",
        "remaining_size": "0",
        "side": "buy",
        "signature": "0x8fdfb5a6f2fc9d25ff844d3ff3de0cc1f226c55cb9c632ff65f5532d6d1ea79f1f35f8ed588dcc2229b12165a2ca986fcde25aedf415adae0586823131db39741b",
        "time_in_force": "gtc",
        "total_fill_size": "63.98",
        "cancel_reason": "cancel_order",
       	"reduce_only": false,
      	"market_seqno": 123457,
        "prev_order_type": "limit"
    },
    "cancel_order_response": {
        "client_order_id": "15895759660216296259",
      	"order_id": "15895759660216296259",
        "status": "canceled",
      	"market_seqno": 123456,
      	"transaction_ts": "1727155069335724372",
      	"size": "1"
    }
  }
]