Deribit Starbase Trade Connector
Features
sbe-deribitConnector KeyNotes
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
marketMakerProtectionsettings. - For the instrument via
deribitMMPcolumn insecuritiesstream. - For the order via
7310order attribute.
Symbology
Deribit uses numeric codes to identify contracts. Codes for a specific market type can be retrieved via a Security Definition request.
Instrument IDs differ between production and sandbox environments.
Use get_instruments endpoint to retrieve instrument ids for test env:
Configuration
Connector settings
| Parameter | Default Value | Description |
|---|---|---|
| host | sbe-order gateway host. | |
| port | sbe-order gateway port. | |
| username | Starbase API Key Client ID. | |
| password | Starbase API Key Client Secret. | |
| selfTradePrevention | CANCEL_RESTING | Defines which order is cancelled when self-match prevention is triggered. Valid values: CANCEL_RESTING, CANCEL_TAKING. |
| selfMatchPreventionId | 0 | Identifier used to prevent self trading. Orders with the same ID will not match against each other. Set to 0 (default) to disable SMP enforcement. |
| cancelOnDisconnect | true | Toggle session-level Cancel on Disconnect option. |
| marketMakerProtection | false | Toggle Market Maker Protection option. |
| heartbeatInterval | 5s | Interval between session heartbeats. |
| resetSeqNums | false | Enforce sequence reset on (re)connect. |
| ➡️ Logging Settings | ||
| log.logMaxFiles | 30 | Max number of log files to keep on disk. |
| log.logMaxFileSize | 100M | Max file size of single log file. |
| log.logBufferSize | 4M | Max buffer size. |
| ➡️ Order Cache Settings | ||
| cache.initialActiveCacheSize | 256 | Initial active order cache size. |
| cache.inactiveCacheSize | 8192 | Inactive order cache size. |
Supported order attributes
| Key | Description |
|---|---|
| 18 | Set to 6 for Post-Only orders. Applicable only for new order submission. |
| 7310 | Market 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
- Windows
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
set EMBER_INSTALL=C:/Deltix/Ember
set EMBER_WORK=C:/Deltix/QuantServerHome/EmberHome/work
%EMBER_INSTALL%/lib/custom/tools/deribit-sbe-log-to-json.bat --log-dir %EMBER_WORK%/connectors/DERIBIT --output-dir %EMBER_WORK% --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
- Windows
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
set EMBER_INSTALL=C:/Deltix/Ember
set EMBER_WORK=C:/Deltix/QuantServerHome/EmberHome/work
%EMBER_INSTALL%/lib/custom/tools/sbe-session-state-transformer.bat --session-state %EMBER_WORK%/connectors/DERIBIT/DERIBIT.state --inbound 567