REST API
Last updated
Last updated
The base URL for endpoints described in this page of live trading API is https://api.cube.exchange/os/v0
.
Definitions for requests and responses can be found in the .
Further specifics for field enums, reject codes, etc. can be found in the .
Endpoints in this section require . Note that only API keys with access-level WRITE
are able to access any of these endpoints.
Cancel all resting orders, optionally limiting to a particular market and / or order book side.
The subaccount to cancel orders for.
A request ID that is echoed back on the MassCancelAck and individual CancelOrderAck's.
If specified, only orders on the corresponding market will be canceled.
If specified, only orders with this side will be canceled.
Place a new order.
Execution details: - For market orders, exactly one of quantity
or quote_quantity
must be specified. - For MARKET_WITH_PROTECTION, if price
is specified, it will override the default protection price. - Matching will stop upon reaching the protection price, or quantity
(or quote_quantity
) filled. - When specifying quote_quantity
, the order is considered 'fully filled' when there is insufficient remaining quote quantity to fill 1 lot at the next trade price. In that case, there will not be a CancelOrderAck
published.
A unique order ID assigned by the client for this order. The ID must be unique among open orders by this subaccount.
A request ID that is echoed back on the NewOrderAck or NewOrderReject
Required for LIMIT orders.
The subaccount to place this order on. This subaccount must be writable by the API key specified in the Credentials message.
If true, this order will be automatically cancelled after the closure of the network connection between Cube's servers and the client that placed the order.
If the client initiates the disconnect or network instability drops the connection, the order will be cancelled when Cube's servers recognize the disconnection.
In the event of a server-side disconnect that causes a halt in trading, such as scheduled downtime, the order will be cancelled before trading resumes.
The quantity of the quote asset that the user wants to spend (for a BID) or receive (for an ASK). For limit orders, this is immediately converted to a base quantity using the provided price. For market orders, this is the maximum quantity that will be executed.
Note that lot size rules will be respected, and the actual quantity executed will be expressed in base quantity units.
Cancel a resting order. Note that this can be done before the order is acknowledged (an aggressive cancel) since the identifying field is the client_order_id
.
The order ID specified by the client on the NewOrder request.
A request ID that is echoed back on the CancelOrderAck or CancelOrderReject
The subaccount that the NewOrder was placed on.
Modify a resting order. - If the newPrice
and the current resting order's price is the same, and newQuantity
is not greater, then the modify is considered a modify down, and the FIFO queue priority is maintained. Otherwise, the modify-order request is treated as an atomic cancel-replace and the replacement order is placed at the end of the FIFO queue for the new price level. - If post-only is specified and the replacement order would trade, then the request is rejected and the current resting order remains resting.
Currently, in-flight-mitigation (IFM) is always enabled. That is, the cumulative fill qty is subtracted from newQuantity
to calculate the new resting quantity. For example:
text | Resting | Filled ---------+---------+-------- New 5 | 5 | 0 Fill 2 | 3 | 2 Modify 4 | 2 | 2
The post-modify quantity will be newQuantity - filled = 4 - 2 = 2
.
Regardless of IFM, the invariant for order quantity is that quantity = remaining_quantity + cumulative_quantity
.
The order ID specified by the client on the NewOrder request.
A request ID that is echoed back on the ModifyOrderAck or ModifyOrderReject
The subaccount that the NewOrder was placed on.