monaco.api.positions
Source: protos/api/positions.proto
Use PositionsService for isolated-margin position management.
Notes
- Position RPCs are authenticated.
- TP/SL can be attached to existing positions through
AttachPositionTpSl. ListPositions,GetPositionandGetPositionRiskread each market’s index price from the matching engine and returnUNAVAILABLEwhen that read fails transiently (retry); any other failure of that read isINTERNAL.ClosePositiondraws one item from the per-account risk-reduction order budget it shares with cancels;BatchCloseAlldraws one item per open position it closes (an empty call draws one): the first 100 are charged before anything is sent and over budget the whole call is refused, while positions past 100 that the budget does not cover are not sent and come back inresultswithRATE_LIMIT_EXCEEDED. Both returnRESOURCE_EXHAUSTEDwith agoogle.rpc.RetryInfodetail when the budget is enforced and spent, before anything reaches the matching engine. See Rate Limits.Position.cum_fees, when present, is the whole-life fee total on open and terminal rows; it is absent while fee history is unavailable or incomplete — before the position’s first PnL sample, after retention, or on a terminal row until the final close is recorded. On a terminal row,exit_price,funding_paid,fees_paid(closing-side only),net_realized_pnlandrealized_roecome from the reducing executions when they reconcile withrealized_pnl, andsize/isolated_margincarry the lifetime closed quantity and allocated initial margin.ListPositionsandListPositionHistoryare cursor-paginated: send an emptypage_tokento start, then each response’snext_page_tokenuntil it comes back empty;page_sizeis 1 to 1000. There is nopagefield: a stub generated from an older proto that still sets it is not rejected (protobuf discards the unknown field) and reads the first page on every call, so regenerate stubs and walk the token.Position.opened_at(RFC 3339) is the fill that took the position’s exposure from zero to non-zero; it never changes for the position id and is absent when unknown.

