Skip to main content

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.

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.

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 whether DIRECT_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:
  1. All open DIRECT_ACCESS orders and quotes for the portfolio are cancelled.
  2. Any subsequent DIRECT_ACCESS order or quote submission is rejected until the portfolio is unlocked.
REST-submitted orders are not subject to the lock — only binary DIRECT_ACCESS order flow is gated. GET /api/v2/private/lock_portfolio

Unlocking

Unlocking restores normal acceptance of DIRECT_ACCESS order entry. Orders cancelled by the preceding lock are not reinstated; clients must resubmit any desired positions. GET /api/v2/private/unlock_portfolio
After a lock, cancelled orders are gone permanently. Unlocking the portfolio does not restore them.

Relationship to Other Risk Controls

Portfolio management complements but does not replace other Starbase risk features:
ControlScopeTrigger
Cancel on DisconnectSessionTCP disconnection or missed heartbeat
Mass Cancel (binary)Portfolio, filteredExplicit client request via SBE
Mass Cancel (REST)Portfolio, unfilteredExplicit client request via REST
Portfolio lockPortfolioExplicit client request via REST
MMPUnderlying, MMP-tagged ordersExposure limit breach