roq-deribit#
Links#
Purpose#
Maintain network connectivity with the Deribit exchange
Route exchange updates to connected clients
Route client requests to the relevant exchange accounts
Stream all messages to an event-log
Overview#
Products
Spot |
|
Futures |
✓ |
Options |
✓ |
Market Data
Reference Data |
✓ |
Market Status |
✓ |
Top of Book |
✓ |
Market by Price (L2) |
✓ |
Market by Order (L3) |
|
Trade Summary |
✓ |
Statistics |
✓ |
Order Management
Create |
✓ |
Modify |
✓ |
Cancel |
✓ |
Cancel All |
✓ |
Auto Cancellation |
✓ |
Account Management
Positions |
✓ |
Funds |
✓ |
Conda#
$ mamba install \
--channel https://roq-trading.com/conda/stable \
roq-binance
$ cp $CONDA_PREFIX/share/roq-deribit/config.toml $CONFIG_FILE_PATH
# Then modify $CONFIG_FILE_PATH to match your specific configuration
$ roq-deribit \
--name "deribit" \
--config_file "$CONFIG_FILE_PATH" \
--client_listen_address "$UNIX_SOCKET_PATH" \
--service_listen_address "$TCP_LISTEN_PORT" \
--flagfile "$FLAG_FILE"
Config#
Flags#
$ roq-deribit --help
|
The |
|
The |
Environments#
# flagfile
--fix_uri=tcp://www.deribit.com:9881
--ws_uri=wss://www.deribit.com/ws/api/v2
# multicast (optional)
--local_interface=192.168.188.1 # this is specific to your host
--multicast_address=239.111.111.1,239.111.111.3
--multicast_port_events=6100
--multicast_port_snapshot=6101
# flagfile
--fix_uri=tcp://test.deribit.com:9881
--ws_uri=wss://test.deribit.com/ws/api/v2
Market Data#
Event |
Stream |
Messages |
Comments |
---|---|---|---|
MarketData |
SecurityList (y) |
||
WebSocket |
ticker |
||
WebSocket |
quote |
||
MarketData |
MarketDataSnapshotFullRefresh (W), MarketDataIncrementalRefresh (X) |
||
Unavailable |
|||
MarketData |
MarketDataIncrementalRefresh (X) |
||
MarketData |
MarketDataIncrementalRefresh (X) |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Statistics#
Type |
Comments |
---|---|
|
Value of Index for INDEX instruments like BTC-DERIBIT-INDEX. MarketDataIncrementalRefresh (X) / MDEntryType (269) / Index Value (3). |
|
Estimated Delivery Price for INDEX instruments like BTC-DERIBIT-INDEX MarketDataIncrementalRefresh (X) / MDEntryType (269) / Settlement Price (6). |
|
Open interest for the symbol. MarketDataIncrementalRefresh (X) / OpenInterest (790) |
|
Mark price for the symbol. MarketDataIncrementalRefresh (X) / MarkPrice (100090) |
Order Management#
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
ExecutionReport (8) |
||
OrderEntry |
ExecutionReport (8) |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
private/get_user_trades_by_currency |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
NewOrderSingle (D) |
||
OrderEntry |
OrderCancelReplaceRequest (G) |
||
OrderEntry |
OrderCancelRequest (F) |
||
OrderEntry |
OrderMassCancelRequest (q) |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
ExecutionReport (8), OrderCancelReject (9), Reject (3) |
Order Types#
Type |
Comments |
---|---|
|
Mapped to |
|
Mapped to |
Time in Force#
Type |
Comments |
---|---|
|
Mapped to |
|
Mapped to |
|
Mapped to |
Position Effect#
Note
Not supported
Execution Instructions#
Type |
Comments |
---|---|
|
Mapped to |
|
Mapped to |
Account Management#
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
RequestForPositions (AN) / PositionReport(AP) |
||
Unavailable |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
RequestForPositions (AN) / PositionReport(AP) |
||
DropCopy |
private/get_account_summary |
Streams#
Type |
Comments |
---|---|
FIX |
Primary purpose
Each connection
|
Type |
Comments |
---|---|
WebSocket |
Primary purpose
Each connection
|
Type |
Comments |
---|---|
FIX |
Primary purpose
Each connection
The master account is used to
|
Type |
Comments |
---|---|
WebSocket |
Primary purpose
Each connection
The first connection is used to
|
Type |
Comments |
---|---|
UDP |
Primary purpose
|
Constraints#
The gateway requires a master account definition to be functional. This is needed by the FIX protocol, even for the market data connection.
The field
DeribitLabel
(FIX tag 100010) is limited to 64 charactersThe multicast feed can only be used by a single effective user id. This is a Linux restriction.
The multicast protocol is flawed due to the snapshot channel containing no more than 10k levels (on either side) and the events channel including book updates for all levels.
Note
There are currently no work-arounds implemented to deal with this.
Comments#
The gateway must be restarted at least daily if you use the multicast feed. The reason is the snapshot vs events inconsistency mentioned under the constraints. The book effectively becomes more and more wrong for big market moves.