monaco.api.orders
Source: protos/api/orders.proto
Use OrdersService for authenticated order management.
Notes
- Order creation, cancellation, replacement, and listing require authentication.
- Batch RPCs are the preferred path for multi-order workflows.
BatchCancelAllandBatchCancelAllByPairreturnUNAVAILABLEwith the codeOVERLOADEDwhen the exchange refuses the call before admission: nothing is cancelled, so back off and retry. Any otherUNAVAILABLE(a transient matching-engine or transport failure) can arrive after the cancel ran, so read your open orders before acting on it.CancelAllAfterarms, refreshes or disarms a dead man’s switch.timeout_msis0to disarm, otherwise 5000–900000; settrading_pair_idto scope the timer to one pair (the account-wide timer and each pair’s timer are separate). Unless you call again before the deadline, resting limit orders, triggered TP/SL legs resting on the book and TWAP parents that are not reduce-only are cancelled with terminal reasonCANCEL_ALL_AFTER, and your RFQ quotes standing since before the deadline in RFQs still collecting quotes are withdrawn by the RFQ service shortly after. A timer that fires is spent. A bad timeout or pair isINVALID_ARGUMENT; a delegated session withouttrading_pair_idor cancel permission on that pair isPERMISSION_DENIED; each call costs one risk-reduction rate-limit item (RESOURCE_EXHAUSTEDover it);UNAVAILABLEwith error codeOVERLOADEDmeans nothing changed, and any otherUNAVAILABLEhas an unknown outcome. The call is safe to retry. See Cancel All After.- Attach TP/SL through order placement or
PositionsService.AttachPositionTpSl. GetConditionalOrderfetches a single TP/SL order by UUID — the same IDs returned astake_profit_order_idandstop_loss_order_idinCreateOrderResponse.- A trigger and the order it fires into are linked in both directions, and both reads are owner-scoped.
GetConditionalOrderandListConditionalOrderscarrytriggered_order— the close’s current status, filled quantity, average fill price, taker fees, fill time and terminal reason, read from that order at request time — present only oncestateis TRIGGERED and the close can be read, never on a FAILED conditional, and never on theconditional_ordersWebSocket frames.GetOrder/ListOrderscarry the reverse pointerconditional_order_idon a close the engine placed for a trigger; it is absent on client-placed orders, on TWAP children (they carryparent_order_id), and on closes older than the field, which are not backfilled. ListOrdersreturns book orders only (LIMITandMARKET): TWAP parents and conditional (TP/SL) orders are not rows of it under anystatusortrading_modefilter and are not counted intotal; list them withListTwapOrdersandListConditionalOrders. A TWAP’s slices — the child orders it places, which carryparent_order_id— are not rows of it either, resting or finished, and are not counted: read them withListTwapOrderSlices. The close a trigger fired into is a book order and is listed as its own row carryingconditional_order_id.ReplaceOrderandBatchReplaceOrderscarry an entry order’s pending take-profit and stop-loss legs onto the replacement and re-check them as placement would: a fixed trigger on the wrong side of the replacement’s expected entry fails a singleReplaceOrderwithINVALID_ARGUMENT, and inBatchReplaceOrdersthe RPC returnsOKwith that item’sresults[].error.codeset toINVALID_ORDER; either way the original keeps resting. A replacement that fills on arrival arms the carried legs — a fixed TP/SL on any fill, a trailing stop on a full fill.ReplaceOrderandBatchReplaceOrdersrefuse to replace the LIMIT leg a TP/SL fired into — an order carryingconditional_order_id— the way a passive TWAP child is refused: a replacement rests under a new order id the conditional does not point at, which would sever the link both ways. The refusal names the conditional order and the original leg stays resting; in a batch the refused item’s original is never cancelled. Cancelling a triggered leg is unchanged.- TWAP parent orders execute a large order as scheduled market child orders across a time window.
CreateTwapOrder,CancelTwapOrder,GetTwapOrder, andListTwapOrdersmanage the parent lifecycle;GetTwapOrderreturns theTwapOrderread model directly. Delegated-agent sessions are rejected for all TWAP RPCs. See TWAP Orders for the execution model. GetTwapOrderTcareturns the post-execution transaction cost analysis report for a terminal TWAP parent (COMPLETEDorCANCELLED). A non-terminal parent isINVALID_ARGUMENT; another user’s parent isNOT_FOUND, indistinguishable from an unknown ID. The six analytics fields are optional and absent when they cannot be computed honestly.ListTwapOrderSliceslists one TWAP parent’s child orders (its slices), each aGetOrderResponseexactly asGetOrderreturns it withparent_order_idset to the parent, resting and finished alike.order_byisASC(the default, oldest slice first) orDESCbycreated_at;page_sizeis 1-1000 (default 20) andnext_page_tokenis minted only while a further page exists, pinned to the parent andorder_bythat minted it. APASSIVEparent’s reprices and deadline sweeps are child orders too, so a parent can have more slices thanslices_placed. Another user’s parent isNOT_FOUND, indistinguishable from an unknown ID.

