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
--exchange (dydx)

exchange identifier (string)

--request_limit (8)

request limit per interval

--request_limit_interval (5s)

request limit monitor interval

--encode_buffer_size (1048576)

encode buffer size

--decode_buffer_size (10485760)

decode buffer size

--mbp_allow_price_inversion (true)

allow price inversion?

--mbp_max_depth

max depth levels (count)

--rest_uri (https://api.stage.dydx.exchange)

REST end-point (URI)

--rest_proxy

REST proxy end-point (URI)

--rest_ping_freq (5s)

ping frequency

--rest_ping_path (/v3/time)

URI path used for REST connection keep-alive messages

--rest_request_timeout (30s)

request: timeout

--ws_uri (wss://api.stage.dydx.exchange/v3/ws)

WebSocket end-point (URI)

--ws_ping_freq (5s)

ping frequency

Environments#

$ $CONDA_PREFIX/share/roq-dydx/flags
# flagfile for the roq-dydx gateway

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

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