Deribit

roq-deribit

Environments

Production

Option

Value

Type

Comment(s)

--fix-uri

tcp://www.deribit.com:9881

FIX

--ws-uri

wss://www.deribit.com/ws/api/v2

WebSocket

Data center

LD4, Equinix, Slough, UK

Test

Option

Value

Type

Comment(s)

--fix-uri

tcp://test.deribit.com:9881

FIX

--ws-uri

wss://test.deribit.com/ws/api/v2

WebSocket

Data center

LD4, Equinix, Slough, UK

Installation

Conda

Install

conda install -y roq-deribit

Configuration

cp $CONDA_PREFIX/share/roq/deribit/config.toml $CONFIG_FILE_PATH

# then modify $CONFIG_FILE_PATH to match your specific configuration

Using

roq-deribit \
      --name "deribit" \
      --config-file "$CONFIG_FILE_PATH" \
      --client-listen-address "$UNIX_SOCKET_PATH" \
      --metrics-listen-address "$TCP_LISTEN_PORT" \
      --fix-uri "$FIX_URI" \
      --ws-uri "$WS_URI"

Flags

Only notable flags are mentioned here. Please refer to roq-deribit --help for all flags.

--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.

Ansible

Edit your inventory file and add your server to the roq_deribit group

[roq_deribit]
MY_SERVER

Docker

docker pull roqtrading/roq-deribit

Note

Please contact us, if you want to use the Docker image.

Implementation

Restrictions

FIX connection

We currently only support tcp.

PositionUpdate, FundsUpdate

Only downloaded immediately after connection has been established.

Incoming Events

Event

Connection

Message(s)

Comment(s)

ReferenceData

FIX

SecurityList

MarketStatus

WS

ticker

FIX SecurityStatus is unfortunately not useful because it only supports polling (snapshot). Furthermore, SecurityStatusRequest only supports per-symbol requests thereby causing us to quickly trigger the rate limiter

TopOfBook

WS

ticker

MarketByPrice

FIX

MarketDataSnapshotFullRefresh, MarketDataIncrementalRefresh

MarketByOrder

Not available

TradeSummary

FIX

MarketDataIncrementalRefresh

SessionStatistics

FIX

MarketDataIncrementalRefresh

DailyStatistics

Not available

OrderAck

FIX

ExecutionReport, OrderCancelReject, Reject

OrderUpdate

FIX

ExecutionReport

TradeUpdate

FIX

ExecutionReport

PositionUpdate

FIX

PositionReport

FundsUpdate

FIX

UserResponse

Outgoing Events

Event

Connection

Message(s)

Comment(s)

CreateOrder

FIX

NewOrderSingle

ModifyOrder

FIX

OrderCancelReplaceRequest

CancelOrder

FIX

OrderCancelRequest

Comments

  • Excellent FIX support. Almost all required data is available, including positions and funds.

  • The WebSocket protocol is less than ideal for client processing. The JSON-RPC implementation buries type information deep inside a nested data structure making it impossible to leverage an efficient one-pass parsing algorithm.