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, andnull 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 oneHostHeader per host, real and paper:
Host markets
List host markets is public and returns what you may trade on a host. EachHostMarketSummary has:
venueId,symbolandinstrument, which join it to the venue market;contractDetails, which says what one contract is (see Instruments and sizing);orderTypes:limitis always present;market,triggerLimitandtriggerMarketarenullwhere the market does not offer them. Each carries the market’s order rules: increments, minimums and the options it accepts;settings:leverageandpositionMode, eachnullwhere the market has no such setting.
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.sideis your side, which is your order’s side, not the aggressor’s side.sizeis in native contracts.idis the host’s execution ID, ornullwhen the host has none.roleisMakerorTaker, ornullwhen not reported.
Portfolio
Four reads describe what the account holds. All need an API key; none needs anything but theaccountId (and an instrument for the per-market read).
Positions
AMarketPosition 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, bytype:
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’ssettings says whether each exists there:
settings.leverageisnullwhen the market has no leverage control. Otherwise it givesmin,maxandstep(accepted values are exactlyminplus a whole number of steps), whether you can read it (get), andsetEffectScope: what a change affects (Market, a host-definedMarketGroup, or the wholeAccount), ornullwhen it cannot be set.settings.positionModelists the modes the market offers (Hedging,Netting), with the samegetandsetEffectScope.
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. EachAccountTransaction is one posting of one asset.
amountis signed from your point of view: positive increases the balance, negative decreases it.typeclassifies the posting:TradingFee,FundingPayment,BorrowInterest,Financing,LiquidationFee,Settlement,Rebate,Deposit,Withdrawal,Transfer,Conversion,AdjustmentorOther. A host lists the types it reports inaccountTransactions.supportedTransactionTypes.nativeTypekeeps the host’s own classification.Otheris used only for a real posting whose host meaning has no standard type.idis stable within the account and identical in history and in the transaction stream, so you can merge the two without duplicates.groupIdlinks postings that come from one host record, such as the settlement and fee of one execution.
accountTransactions.listTransactions capability states. A host without transaction history returns 422 NotSupported.
Related
- Venues and hosts for where hosts fit.
- Host capabilities and Order rules to decide what to send.
- Orders, Streams and Portfolio for how-to guides.
- Paper trading for paper hosts.