Skip to content
Tradable Quantity and Margin

Estimate Option Open Quantity

On the single-leg option order page, after the Client enters a price or switches the side, estimates the maximum number of contracts that can be opened by limit price, order type, and side, and returns the initial margin, maintenance margin, and available cash before and after the trade, to show the open quantity and margin change. When direction is CLOSE, the trade closes a position; otherwise it opens one. Do not call this endpoint when the price is 0. When amending an order, pass the original order ID; omit it when the order being amended is an untriggered conditional order. When you need server-side margin details (initial margin, expiring-option margin increase, combination margin reduction, and estimated total margin), use GET /v2/orders/stock_contract/available_open_quantity instead. This endpoint is also used by the option day-trade margin order panel.

When you call this endpoint through WhaleCore requestService(), set requiresTradeToken to true.

WhaleCore's orderService() provides the corresponding capability. If you use WhaleCore, prefer the corresponding orderService() method.

GEThttps://api.lbkrs.com/v1/orders/stock_contract/available_open_quantity

Parameters

counter_idstringqueryRequired

Option contract security ID (counter_id), such as OP/US/AAPL260724C110000

pricestringqueryRequired

Order price (premium per share) in the trading currency

settlement_currencystringqueryRequired

Settlement currency, such as USD or HKD. Use an item of channel_infos.settlement_currency returned by Get Order Configuration

currencystringqueryRequired

Trading currency. Pass the same value as settlement_currency

order_typestringqueryRequired

Order type code, such as LO, MO, or ELO. Use a key of channel_infos.order_type_config returned by Get Order Configuration

actionintegerqueryRequired

Order side:

  • 1 - Buy
  • 2 - Sell

12

order_idstringquery

Original order ID when amending an order. Omit it for a new order or when the order being amended is an untriggered conditional order

order_id_strstringquery

String form of the original order ID. When amending, pass the same value as order_id

Responses

HTTP 200The request succeeded. The response body contains the result of the “Estimate Option Open Quantity” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
cash_max_qtystring

Maximum contracts with cash

margin_max_qtystring

Maximum contracts including margin financing

directionstring

Whether this trade opens or closes a position:

  • OPEN - Open
  • CLOSE - Close
Values
OPEN
CLOSE
before_im_marginstring

Initial margin before the trade

after_im_marginstring

Initial margin after the trade

before_mm_marginstring

Maintenance margin before the trade

after_mm_marginstring

Maintenance margin after the trade

before_available_cashstring

Available cash before the trade

after_available_cashstring

Available cash after the trade

Whale Docs