Understanding Orders Guide

Using the Moment Orders API, a Client can monitor, place, and cancel their orders with Moment. Each order has a unique identifier that will be returned as part of the order object, along with the rest of the fields described below. Once an order is placed, it can be queried using the system-assigned unique ID to check the status. Updates on open orders at Moment will also be sent over the Real-time Orders API, which is the recommended method of maintaining order state.

Creating Orders

Clients can submit requests to purchase or sell fixed income securities through the POST /v1/trading/order/ endpoint:

POST /v1/trading/order/
{
  "account_id": "eb9e2aaa-f71a-4f51-b5b4-52a6c565dad4",
  "instrument_id": "037833DP2",
  "amount": {
  	"par": 3000.0
  },
  "type": "limit",
  "side": "buy",
  "limit_price": 99.5,
  "extended_hours": false
}

After submitting an order request like the one above, the Client receives a unique ID for the order. This ID can then be supplied to the GET /v1/trading/order/{id}/ endpoint to receive the order object corresponding to the Client's order request. The order object includes both information about the Client's request (e.g. account ID, limit price, quantity, direction), as well as information about the current state of the request (e.g. filled quantity, filled average price). Some order fields are immutable and will never change throughout the life of an order: id, isin, cusip, amount, type, side, limit_price, extended_hours. Other order fields are mutable and will change in response to order events: filled_amount, filled_avg_price, status.

GET /v1/trading/order/mo_V1StGXR8_Z5jdHi6B-myT/
{
  "id": "mo_V1StGXR8_Z5jdHi6B-myT",
  "account_id": "eb9e2aaa-f71a-4f51-b5b4-52a6c565dad4",
  "created_at": "2021-03-16T18:38:01.942282Z",
  "approved_at": "2021-03-16T18:38:01.937734Z",
  "filled_at": null,
  "canceled_at": null,
  "isin": "US037833DP29",
  "cusip": "037833DP2",
  "amount": {
  	"par": 3000.0
  },
  "filled_amount": {
  	"par": 1,
  },
  "filled_avg_price": {
    "pop": 90,
    "ytm": 4.6
  },
  "type": "limit",
  "side": "buy",
  "limit_price": 99.5,
  "status": "partially_filled",
  "extended_hours": false
}

Order States and Statuses

An order's status tells API users where the order currently is in its lifecycle. As shown in the table below, there are six possible order statuses: pending_approval, pending_execution, partially_filled, filled, rejected, and canceled.

Moment considers orders whose statuses are pending_approval, pending_execution, or partially_filled to be in the open state, meaning that those orders are actively being processed and their statuses will change in the future. Meanwhile, orders whose statuses are filled, rejected, or canceled are in the closed state, meaning that those orders are no longer being processed and their statuses will never change again.

StatusStateDescriptionPossible Next States
pending_approvalopenThe order has been received and is waiting for approval.rejected
canceled
pending_execution
pending_executionopenThe order has been approved and Moment is attempting to execute the order.partially_filled
filled
canceled
partially_filledopenThe order has been partially filled by one or more executions, and Moment is continuing to attempt to execute the remainder.partially_filled
filled
canceled
filledclosedThe order has been filled. No further updates will occur.None
canceledclosedThe order has been canceled by the client, Moment, or the venue. No further updates will occur.

Note that canceled orders may have been partially filled prior to cancelation.
None
rejectedclosedThe order has been rejected by Moment. No further updates will occur.None

Order Types

When a Client submits an order, they can choose one of the supported order types. Due to lower liquidity in the bond market as compared with the equity market, most fixed income trading venues do not support market orders.

Limit Order

A limit order is an order to buy or sell at a specified price or better. A buy limit order (a limit order to buy) is executed at the specified limit price or lower (i.e., better). Conversely, a sell limit order (a limit order to sell) is executed at the specified limit price or higher (better). Clients must specify the limit price parameter when submitting an order.

While a limit order can prevent slippage, it may not be filled for a quite a bit of time, if at all. For a buy limit order, if the market price is within the specified limit price, Clients can expect the order to be filled. If the market price is equivalent to the limit price, your order may or may not be filled; if the order cannot immediately execute against resting liquidity, then it is deemed non-marketable and will only be filled once a marketable order interacts with it.

Orders Submitted Outside of Eligible Trading Hours

Orders not eligible for extended hours submitted after 4:00pm ET will be rejected.

Extended Hours Trading

Clients can submit and fill orders during pre-market and after-hours.

Currently, we support full extended hours:
Pre-market: 7:30am - 9:30am ET Monday to Friday
After-hours: 4:00pm - 5:00pm ET Monday to Friday

Submitting an Extended Hours Eligible Order

To indicate an order is eligible for extended hours trading, Clients must supply a boolean parameter named extended_hours to the order request. When this parameter is true, the order is be eligible for execution in the pre-market or after-hours. All bonds supported during regular market hours are also supported during extended hours.

Time in Force

All orders submitted via Moment are day orders. A day order is eligible for execution only on the day it is live. By default, the order is only valid during Regular Trading Hours (9:30am - 4:00pm ET). If unfilled by 4:00pm ET, it automatically expires. If submitted after the close, it is rejected. However, if marked as eligible for extended hours, the order can also execute during supported extended hours.

Canceling Orders

Clients can request to cancel an open order through the DELETE /v1/trading/order/{id}/ endpoint:

DELETE /v1/trading/order/mo_V1StGXR8_Z5jdHi6B-myT/

When a Client submits a cancelation request for an order, Moment will attempt to cancel any outstanding order tickets on the trading venues. A cancel request will be rejected if the order is closed, nonexistent, or if a cancel request is already pending.