roq-deribit

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

1
2
3
conda install \
  --channel https://roq-trading.com/conda/stable \
  roq-binance
1
2
3
cp $CONDA_PREFIX/share/roq-deribit/config.toml $CONFIG_FILE_PATH

# Then modify $CONFIG_FILE_PATH to match your specific configuration
1
2
3
4
5
6
roq-deribit \
      --name "deribit" \
      --config_file "$CONFIG_FILE_PATH" \
      --client_listen_address "$UNIX_SOCKET_PATH" \
      --metrics_listen_address "$TCP_LISTEN_PORT" \
      --flagfile "$FLAG_FILE"

Flags

1
roq-deribit --help

--cancel_on_disconnect

The Logon FIX message can be used to instruct the exchange to automatically cancel all orders if the exchange detects a disconnect.

--max_batch_size

The MarketDataRequest FIX message supports the simultaneous subscription of multiple symbols. However, it appears there is a limit (around 56 symbols). This flag controls how many symbols can be subscribed per request.

Environments

1
2
3
4
# flagfile

--fix_uri=tcp://www.deribit.com:9881
--ws_uri=wss://www.deribit.com/ws/api/v2
1
2
3
4
# flagfile

--fix_uri=tcp://test.deribit.com:9881
--ws_uri=wss://test.deribit.com/ws/api/v2

Market Data

Event

Stream

Messages

Comments

roq::ReferenceData

MarketData

SecurityList (y)

roq::MarketStatus

WebSocket

ticker

roq::TopOfBook

WebSocket

quote

roq::MarketByPriceUpdate

MarketData

MarketDataSnapshotFullRefresh (W), MarketDataIncrementalRefresh (X)

roq::MarketByOrderUpdate

Unavailable

roq::TradeSummary

MarketData

MarketDataIncrementalRefresh (X)

roq::StatisticsUpdate

MarketData

MarketDataIncrementalRefresh (X)

Statistics

Type

Comments

INDEX_VALUE

Value of Index for INDEX instruments like BTC-DERIBIT-INDEX

SETTLEMENT_PRICE

Estimated Delivery Price for INDEX instruments like BTC-DERIBIT-INDEX

Order Management

Event

Stream

Messages

Comments

roq::OrderUpdate

OrderEntry

ExecutionReport (8)

roq::TradeUpdate

OrderEntry

ExecutionReport (8)

Event

Stream

Messages

Comments

roq::OrderUpdate

roq::TradeUpdate

DropCopy

private/get_user_trades_by_currency

Event

Stream

Messages

Comments

roq::CreateOrder

OrderEntry

NewOrderSingle (D)

roq::ModifyOrder

OrderEntry

OrderCancelReplaceRequest (G)

roq::CancelOrder

OrderEntry

OrderCancelRequest (F)

roq::CancelAllOrders

OrderEntry

OrderMassCancelRequest (q)

Not implemented

Event

Stream

Messages

Comments

roq::OrderAck

OrderEntry

ExecutionReport (8), OrderCancelReject (9), Reject (3)

Order Types

Type

Comments

MARKET

Mapped to '1' (FIX)

LIMIT

Mapped to '2' (FIX)

Time in Force

Type

Comments

GTC

Mapped to '1' (FIX)

IOC

Mapped to '3' (FIX)

FOK

Mapped to '4' (FIX)

Position Effect

Note

Not supported

Execution Instructions

Type

Comments

PARTICIPATE_DO_NOT_INITIATE

Mapped to '6' (FIX)

DO_NOT_INCREASE

Mapped to 'E' (FIX)

Account Management

Event

Stream

Messages

Comments

roq::PositionUpdate

Unavailable

roq::FundsUpdate

Unavailable

Event

Stream

Messages

Comments

roq::PositionUpdate

DropCopy

private/get_positions

roq::FundsUpdate

DropCopy

private/get_account_summary

Streams

Type

Comments

FIX

Primary purpose

  • support order management

Each connection

  • supports a single account

Type

Comments

WebSocket

Primary purpose

  • live account updates, including positions and funds

Each connection

  • supports a single account

Type

Comments

FIX

Primary purpose

  • live market data (everything else)

Each connection

  • supports a slice of the symbols

The master account is used to

  • authenticate, only

Type

Comments

WebSocket

Primary purpose

  • live market data (top of book + market status)

Each connection

  • supports a slice of the symbols

The first connection is used to

  • download currencies and symbols

Constraints

  • The field DeribitLabel (FIX tag 100010) is limited to 64 characters