The Starbase REST API exposes a set of portfolio-scoped management operations. All endpoints require authentication; the authenticated session determines which portfolio is acted upon.Documentation Index
Fetch the complete documentation index at: https://docs.deribit.com/llms.txt
Use this file to discover all available pages before exploring further.
Mass Cancel
Mass cancel removes every open order and quote belonging to the authenticated portfolio in a single call. Unlike the binary Mass Cancel message, which targets orders by instrument or side, the REST endpoint applies unconditionally — no filters are accepted. The typical use case is risk reduction: a single call clears the entire book across all instruments and both sides. The endpoint returns the total number of orders cancelled across all matching engine shards.Mass cancel via REST is always available and cannot be disabled by admin configuration.
GET /api/v2/private/cancel_all
Portfolio Lock State
The portfolio lock controls whetherDIRECT_ACCESS (SBE binary) order entry is accepted. The lock is a portfolio-level toggle, independent of individual sessions or gateway connections.
Locking
Locking a portfolio has two immediate effects:- All open
DIRECT_ACCESSorders and quotes for the portfolio are cancelled. - Any subsequent
DIRECT_ACCESSorder or quote submission is rejected until the portfolio is unlocked.
DIRECT_ACCESS order flow is gated.
→ GET /api/v2/private/lock_portfolio
Unlocking
Unlocking restores normal acceptance ofDIRECT_ACCESS order entry. Orders cancelled by the preceding lock are not reinstated; clients must resubmit any desired positions.
→ GET /api/v2/private/unlock_portfolio
Relationship to Other Risk Controls
Portfolio management complements but does not replace other Starbase risk features:| Control | Scope | Trigger |
|---|---|---|
| Cancel on Disconnect | Session | TCP disconnection or missed heartbeat |
| Mass Cancel (binary) | Portfolio, filtered | Explicit client request via SBE |
| Mass Cancel (REST) | Portfolio, unfiltered | Explicit client request via REST |
| Portfolio lock | Portfolio | Explicit client request via REST |
| MMP | Underlying, MMP-tagged orders | Exposure limit breach |