roq-dydx#

Purpose#

  • Maintain network connectivity with the Binance 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-dydx
$ cp $CONDA_PREFIX/share/roq-dydx/config.toml $CONFIG_FILE_PATH

# Then modify $CONFIG_FILE_PATH to match your specific configuration
$ roq-dydx \
      --name "dydx" \
      --config_file "$CONFIG_FILE_PATH" \
      --client_listen_address "$UNIX_SOCKET_PATH" \
      --service_listen_address "$TCP_LISTEN_PORT" \
      --flagfile "$FLAG_FILE"

Config#

Flags#

$ roq-dydx --help

--mbp_max_depth

Max depth. Unbounded is the default.

--rest_uri

URI

rest_back_off_delay

Time to wait before retrying a rejected request.

rest_terminate_on_403

Terminate when getting a 403 response code.

--rest_depth_limit

Depth limit. This choice has influence on request limits, please refer to exchange documentation.

--rest_listen_key_refresh

Time between listen key refresh.

--cancel_replace_stop_on_failure

If the cancel request fails, the replacement will not be attempted

--ws_uri

URI

--ws_depth_levels

Max levels for snapshots.

--ws_depth_freq

Conflated depth updates are published at a frequency of either 100ms or 1000ms.

--ws_trade_details

Report individual matches for trade summary?

--ws_max_subscriptions

Subscription limit per web-socket connection

Environments#

# flagfile

--rest_uri=https://api.dydx.exchange
--ws_uri=wss://api.dydx.exchange/v3/ws
# flagfile

--rest_uri=https://api.stage.dydx.exchange
--ws_uri=wss://api.stage.dydx.exchange

Market Data#

Event

Stream

Messages

Comments

roq::ReferenceData

MarketData

v3_markets

roq::MarketStatus

MarketData

v3_markets

roq::TopOfBook

Unavailable

roq::MarketByPriceUpdate

MarketData

v3_orderbook

roq::MarketByOrderUpdate

Unavailable

roq::TradeSummary

MarketData

v3_trades

roq::StatisticsUpdate

MarketData

v3_markets

Event

Stream

Messages

Comments

roq::ReferenceData

MarketData

v3_markets

roq::MarketStatus

MarketData

v3_markets

roq::TopOfBook

Unavailable

roq::MarketByPriceUpdate

MarketData

v3_orderbook

roq::MarketByOrderUpdate

Unavailable

roq::TradeSummary

Not used

roq::StatisticsUpdate

MarketData

v3_markets

Statistics#

Type

Comments

OPEN_INTEREST

(v3_markets) openInterest

INDEX_VALUE

(v3_markets) indexPrice

TRADE_VOLUME

(v3_markets) volume24H

FUNDING_RATE

(v3_markets) nextFundingRate

Order Management#

Event

Stream

Messages

Comments

roq::OrderUpdate

roq::TradeUpdate

Event

Stream

Messages

Comments

roq::OrderUpdate

roq::TradeUpdate

Event

Stream

Messages

Comments

roq::OrderAck

Streams#

Type

Comments

WebSocket

Primary purpose

  • live market data

One connection

Type

Comments

REST

Currently not used

One connection

Constraints#

Comments#