Skip to main content

Deribit Starbase Trade Connector

Features​

sbe-deribitConnector Key
Instruments
FUTURESYNTHETIC
Request Types
SUBMITCANCELREPLACE
Order Types
MARKETLIMIT
Time In Force
DAYGTCIOCFOK
Order ID Mapper
SEQUENCE
✗
Order Status Request
✓
Cancel On Disconnect
✗
Commission
✓
Post Only
✓
Fast Cancel
✓
Fast Replace

Notes​

Description​

Starbase is Deribit’s high-performance matching engine and API for clients who are market making or deploying high-frequency strategies. The API provides lower-latency access through several protocols, including SBE order entry, SBE multicast market data, FIX Drop Copy, and REST.

Connectivity​

The Starbase matching engine and its gateways run in LD4 — none of Deribit’s infrastructure is deployed in the cloud. Clients on AWS can reach Starbase over AWS Private Link without traversing the public internet, but this is a connectivity option only, not a change in where the infrastructure runs.

For the lowest possible network latency, run the latency-sensitive trading stack in LD4 using hosted colocation or a cross-connect. A server in another region, including Tokyo, must still reach the matching engine in London and therefore cannot provide the same round-trip latency as an LD4 deployment.

Cancel on Disconnect​

Cancel On Disconnect (CoD) is a risk management feature that automatically cancels tagged open orders when a connection to the Starbase gateway is lost or terminated. CoD helps prevent orders from remaining active after a client disconnection and reduces exposure to unintended positions.

Session-level CoD is enabled by default: cancelOnDisconnect = true

Starbase API Rate Limits​

Rate limits are applied per member, per gateway, and per quoting type (order entry).

Market Maker Protection​

Market Maker Protection (MMP) helps reduce exposure risk by automatically pausing quoting activity when certain limits are reached. MMP monitors trading activity and automatically cancels all MMP-tagged orders when exposure limits are breached, then freezes quoting for a configured duration.

Market Maker Protection flag can be set:

  • For entire connector via marketMakerProtection settings.
  • For the instrument via deribitMMP column in securities stream.
  • For the order via 7310 order attribute.

Symbology​

Deribit uses numeric codes to identify contracts. Codes for a specific market type can be retrieved via a Security Definition request.

note

Instrument IDs differ between production and sandbox environments.
Use get_instruments endpoint to retrieve instrument ids for test env:

Configuration​

Connector settings​

ParameterDefault ValueDescription
hostsbe-order gateway host.
portsbe-order gateway port.
usernameStarbase API Key Client ID.
passwordStarbase API Key Client Secret.
selfTradePreventionCANCEL_RESTINGDefines which order is cancelled when self-match prevention is triggered. Valid values: CANCEL_RESTING, CANCEL_TAKING.
selfMatchPreventionId0Identifier used to prevent self trading. Orders with the same ID will not match against each other. Set to 0 (default) to disable SMP enforcement.
cancelOnDisconnecttrueToggle session-level Cancel on Disconnect option.
marketMakerProtectionfalseToggle Market Maker Protection option.
heartbeatInterval5sInterval between session heartbeats.
resetSeqNumsfalseEnforce sequence reset on (re)connect.
➡️ Logging Settings
log.logMaxFiles30Max number of log files to keep on disk.
log.logMaxFileSize100MMax file size of single log file.
log.logBufferSize4MMax buffer size.
➡️ Order Cache Settings
cache.initialActiveCacheSize256Initial active order cache size.
cache.inactiveCacheSize8192Inactive order cache size.

Supported order attributes​

KeyDescription
18Set to 6 for Post-Only orders. Applicable only for new order submission.
7310Market Maker Protection. Allowed values: true, false.

Config sample​

connectors {
DERIBIT: ${template.connector.sbe.deribit} {
settings {
host = "<HOST>"
port = <PORT>

username = "<API_CLIENT_ID>"
password = "<API_CLIENT_SECRET>"
}
}
}

Tools​

Message Log To Json Converter​

Converts Deribit binary logs (*.messages) to JSON format.
Usage: deribit-sbe-log-to-json --log-dir <message-logs-dir> --output-dir <output-dir> --heartbeats

docker compose exec ember /opt/deltix/ember/lib/custom/tools/deribit-sbe-log-to-json --log-dir /var/lib/emberwork/connectors/DERIBIT --output-dir /var/lib/emberwork --heartbeats

Session State Transformer​

Modifies connector's session state file.
Usage: sbe-session-state-transformer --session-state <session-state-file> --inbound <new-target-seq-num> --outbound <new-sender-seq-num>

docker compose exec ember /opt/deltix/ember/lib/custom/tools/sbe-session-state-transformer --session-state /var/lib/emberwork/connectors/DERIBIT/DERIBIT.state --outbound 345