Orders

The orders API contains private endpoints for submitting orders and querying order state. Requires a base64-encoded SHA256 HMAC signature as defined in Authentication.

Submitting Orders

HTTP MethodEndpoint
POST/orders

Orders on the Bitnomial Exchange are bids to buy a product, or asks to sell that product. Beyond the order price and quantity requested, an order is treated differently based on its time-in-force, of which there are three:

  • immediate-or-cancel (IOC) orders will be cancelled if they cannot be matched immediately;
  • day orders are valid until they either match, get cancelled explicitly by the user, or the end of the daily trading session is reached.
  • good-till-cancel (GTC) orders are valid until they match, get cancelled explicitly by the user, or the product they refer to is no longer listed.

Note: Order submissions are currently only available in the production environment.

Request Parameters

The supported query parameters are:

ParameterOptionalityNotes
account_idrequiredAccount code assigned by your clearing firm.
short_clearing_firm_namerequiredShort code associated with your clearing firm.

The body of the POST request is a JSON object, expected to have the following fields:

FieldNotes
product_symbolSymbol of the product. See the Product API to get a view of available products in real-time.
sideSide of the order, i.e. whether this order is a bid or ask.
pricePrice of the bid or ask in ticks. See the Product API for the conversion between price and tick of any product. See the WebSocket Protocol to keep track of recent prices by product.
quantity_requestedAmount of contracts requested, which must be strictly greater than 0.
time_in_forceOrder time-in-force. See above for a description of the semantics of time-in-force.

The schema of the body of the request is formally defined as:

export type OrderSubmission = {
  price: number;
  product_symbol: string;
  quantity_requested: number;
  side: Side;
  time_in_force: TimeInForce;
};

export type Side = 'Bid' | 'Ask';

export type TimeInForce = 'IOC' | 'Day' | 'GTC';

Querying Order State

HTTP MethodEndpoint
GET/orders

The endpoint supports the following query parameters:

ParameterOptionalityNotes
symboloptionalFilter orders by product symbol, only works in production
product_idoptionalFilter orders by product ID, only works in production
product_typeoptionalFilter orders by product type, only works in production
clearing_firm_codeoptionalFilter orders by clearing firm code, only works in production
account_idoptionalFilter orders by account code, only works in production
connection_idoptionalFilter orders by connection ID, only works in production
dayoptionalGet range for day, overrides begin_time and end_time
limitoptionalLimit number of orders per page
begin_timeoptionalBegin time for order time range, see Time for more details
end_timeoptionalEnd time for order time range, see Time for more details
orderoptionalPage order, either asc or desc
cursoroptionalCursor string for paginated query

The endpoint returns a pagination response of the type Pagination<Order, CursorInfo>. More details on paginated APIs can be found in Pagination. Order is defined as follows:

export interface Order {
  symbol: string;
  product_id: number;
  product_type: ProductType;
  id: string;
  connection_id: string;
  clearing_firm_code: string;
  account_id: string;
  open_ack_id: string;
  side: Side;
  price: number;
  quantity_requested: number;
  quantity_filled: number;
  status: OrderStatus;
  time_in_force: TimeInForce;
}

export type ProductType = "Future" | "Spread" | "Option";

export type Side = 'Bid' | 'Ask';

export type OrderStatus = 'Working' | 'Closed';

export type TimeInForce = 'IOC' | 'Day' | 'GTC';

Start Trading

Trade US Perpetual Futures, Physical Futures, and Options on the Bitcoin Complex®, XRP, ETH, SOL, and more.