Skip to main content

Module models

Module models 

Source
Expand description

Request and response models of the REST API, one struct per JSON shape of the broker.

The models are the Simple format of the broker: the original field names, which the client always asks for. Almost every field of a reply is an Option or has a default, because the broker fills only what fits the object, so check before you use a field. Numbers are read as decimals, never through f64. All dates and times of the broker are UTC.

Quantities. The broker counts orders in lots. Its replies carry the quantity both in lots (qty, qty_batch) and in pieces (qty_units), and the connector reads the pieces.

Structs§

AllTradesHistory
The answer of GET /md/v2/Securities/{exchange}/{symbol}/alltrades/history: a page of trades and their total.
Bar
A candle of GET /md/v2/history and of the candle subscription.
BookLevel
One level of an order book.
BuyingPowerByCurrency
The money of a currency in the summary.
HistoryResponse
The answer of GET /md/v2/history: candles and the Unix times of the neighbouring pages.
InstrumentRef
The instrument of an order command.
LimitOrderRequest
The body of a limit order command (POST .../orders/actions/limit and the change PUT .../limit/{orderId}).
MarketOrderRequest
The body of a market order command (POST .../orders/actions/market and PUT .../market/{orderId}).
MarketStatus
An item of GET /md/status/{exchange}/{market}: the state of the trading session of a market.
MarketTradeRecord
A trade of the market: the item of GET /md/v2/Securities/{exchange}/{symbol}/alltrades and the message of the all trades subscription.
OrderBook
An order book: the answer of GET /md/v2/orderbooks/{exchange}/{symbol} and the message of the order book subscription.
OrderCommandResponse
The answer to an order command: the number of the order the broker made.
OrderRecord
An order of the portfolio: the item of GET /md/v2/Clients/{exchange}/{portfolio}/orders, the answer of the call for one order and the message of the orders subscription.
PositionRecord
An instrument or money position: the item of GET /md/v2/Clients/{exchange}/{portfolio}/positions and the message of the positions subscription.
QuoteRecord
A quotation: the item of GET /md/v2/Securities/{symbols}/quotes and the message of the quotes subscription.
SecurityInfo
An instrument: the answer of GET /md/v2/Securities/{exchange}/{symbol} and an item of the list GET /md/v2/Securities.
StopOrderRecord
A stop order of the portfolio: the item of GET /md/v2/Clients/{exchange}/{portfolio}/stoporders, the answer of the call for one stop order and the message of the stop orders subscription.
StopOrderRequest
The body of a stop order command: POST .../orders/actions/stop (a market order on trigger) and .../stopLimit (a limit order on trigger, with price), and the changes PUT .../stop/{id} and .../stopLimit/{id}.
SummaryRecord
The summary of the portfolio: GET /md/v2/Clients/{exchange}/{portfolio}/summary and the message of the summaries subscription.
TradeRecord
A trade of the portfolio (a fill of one of its orders): the item of GET /md/v2/Clients/{exchange}/{portfolio}/trades and the message of the trades subscription.
UserRef
The portfolio of an order command.