Binance

roq-binance

Environments

Production

Option

Value

Type

Comment(s)

--rest-uri

https://api.binance.com

REST

--ws-uri

wss://stream.binance.com:9443/stream

WebSocket

Data center

Japan (to be confirmed)

Test

Warning

Does not exist.

Installation

Conda

Install

conda install -y roq-binance

Configuration

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

# then modify $CONFIG_FILE_PATH to match your specific configuration

Using

roq-binance \
      --name "binance" \
      --config-file "$CONFIG_FILE_PATH" \
      --client-listen-address "$UNIX_SOCKET_PATH" \
      --metrics-listen-address "$TCP_LISTEN_PORT" \
      --rest-uri "$REST_URI" \
      --ws-uri "$WS_URI"

Flags

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

--rest-depth-limit

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

--rest-listen-key-refresh-secs

Time between listen key refresh.

--ws-depth-levels

Max levels for snapshots.

--ws-depth-freq-msecs

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

Ansible

Add your host to the roq_binance group

[roq_binance]
MY_SERVER

Docker

docker pull roqtrading/roq-binance

Implementation

  • Market by Price is currently subscribed as full snapshot (with limited depth) due to rate limitations on fetching the initial images from the REST connection.

Restrictions

Incoming Events

Event

Connection

Message(s)

Comment(s)

ReferenceData

REST

/api/v3/exchangeInfo

MarketStatus

REST

/api/v3/exchangeInfo

TopOfBook

WS_MARKET

<symbol>@bookTicker

MarketByPrice

REST

/api/v3/depth?limit=<levels>

See Flags

WS_MARKET

<symbol>@depth@<freq> or <symbol>@depth<levels>@<freq>

See Flags

MarketByOrder

Not available

TradeSummary

WS_MARKET

<symbol>@trade or <symbol>@aggTrade

See Flags

SessionStatistics

WS_MARKET

<symbol>@miniTicker

DailyStatistics

WS_MARKET

<symbol>@miniTicker

OrderAck

REST

/api/v3/order

WS_USER

executionReport

OrderUpdate

WS_USER

executionReport

TradeUpdate

WS_USER

executionReport

PositionUpdate

FundsUpdate

REST

/api/v3/account

WS_USER

outboundAccountInfo and outboundAccountPosition

Outgoing Events

Event

Connection

Message(s)

Comment(s)

CreateOrder

REST

/api/v3/order (POST)

ModifyOrder

Not available

CancelOrder

REST

/api/v3/order (DELETE)