Skip to main content
A host holds trading accounts and executes orders on a venue’s markets: an exchange’s own account service, or a paper host that simulates one. Every account action goes through a host, and every host uses the same operations and the same shapes. This page explains that model. For step-by-step trading, see Orders, Streams and Portfolio.

Promise only what every host can keep

Plurex aggregates hosts that report different things. Its models follow one rule: a field is required only when every supported host can report it truthfully. Anything a host may not report is nullable, and null always means “the host did not report it”. Plurex never estimates, derives or backfills a value the host did not give. Where hosts differ in what they support, rather than what they report, the difference is declared in their capabilities and market summaries. See Capabilities.

The host header

List hosts is public and returns one HostHeader per host, real and paper:

Host markets

List host markets is public and returns what you may trade on a host. Each HostMarketSummary has:
  • venueId, symbol and instrument, which join it to the venue market;
  • contractDetails, which says what one contract is (see Instruments and sizing);
  • orderTypes: limit is always present; market, triggerLimit and triggerMarket are null where the market does not offer them. Each carries the market’s order rules: increments, minimums and the options it accepts;
  • settings: leverage and positionMode, each null where the market has no such setting.
Plurex validates orders against exactly these rules and never rounds your input. See Order rules.

Orders

Submit one of four order types with Submit an order: The host returns an Order, the same shape that Get an order, the list operations and the order stream return. It is host-reported state:

Order state

These four states are the set every host can report without guessing. There is no PartiallyFilled state: check sizeTraded. There is no updatedAt: an order has createdAt, and each fill has its own executedAt.

What an order does not echo

The options you submit (tif, postOnly, reduceOnly, positionEffect) are not echoed back, because hosts do not report them consistently. Keep your own record of what you sent, keyed by id or clientOrderId. For Market and TriggerMarket orders, sizing is the requested amount and unit as the host accepted it. The host may round a notional. It is null when the host does not report both, because a guessed unit would be worse than none: Size and Notional read very differently. averagePrice is the host’s own figure. Plurex does not calculate it from fills, so it can be null while sizeTraded is above zero.

Fills

List fills returns executions for one order, one instrument or the whole account; which variants a host offers is in its capabilities.
  • side is your side, which is your order’s side, not the aggressor’s side.
  • size is in native contracts.
  • id is the host’s execution ID, or null when the host has none.
  • role is Maker or Taker, or null when not reported.

Portfolio

Four reads describe what the account holds. All need an API key; none needs anything but the accountId (and an instrument for the per-market read).

Positions

A MarketPosition always has both a long and a short leg, each with a size in native contracts and an entryPrice when the host reports it. In Netting mode the market holds one net position, so at most one leg is non-zero. In Hedging mode both can be open at once:
mode is null when the host does not report it.

Per-market account state

Get market account state answers “what can I do on this market right now?” in one call. The result is one of three shapes, by type: Spot margin that a host offers only per order is not modelled; those markets are returned as Spot.

Market settings: leverage and position mode

Leverage and position mode are settings of a market on your account, not fields on an order. A market’s settings says whether each exists there:
  • settings.leverage is null when the market has no leverage control. Otherwise it gives min, max and step (accepted values are exactly min plus a whole number of steps), whether you can read it (get), and setEffectScope: what a change affects (Market, a host-defined MarketGroup, or the whole Account), or null when it cannot be set.
  • settings.positionMode lists the modes the market offers (Hedging, Netting), with the same get and setEffectScope.
Get market leverage returns one of three settings: settings.leverage: null means the market has no leverage control, so you cannot get or set it. Disabled from Get market leverage means the control exists and is off. A Derivative market state always includes currentLeverageSetting; on a market with no leverage control (for example on a paper host) it reads Disabled, meaning orders are not leveraged. Set market leverage and Set market position mode return the resulting setting and are safe to repeat with the same values. When setEffectScope is wider than Market, re-read the other markets it affects rather than assume.

Transactions

List transactions returns the account’s balance postings: the ledger behind its wallets. Each AccountTransaction is one posting of one asset.
  • amount is signed from your point of view: positive increases the balance, negative decreases it.
  • type classifies the posting: TradingFee, FundingPayment, BorrowInterest, Financing, LiquidationFee, Settlement, Rebate, Deposit, Withdrawal, Transfer, Conversion, Adjustment or Other. A host lists the types it reports in accountTransactions.supportedTransactionTypes.
  • nativeType keeps the host’s own classification. Other is used only for a real posting whose host meaning has no standard type.
  • id is stable within the account and identical in history and in the transaction stream, so you can merge the two without duplicates.
  • groupId links postings that come from one host record, such as the settlement and fee of one execution.
Results come in the order the host’s accountTransactions.listTransactions capability states. A host without transaction history returns 422 NotSupported.