roq-whitebit

$ conda install \
      --channel https://roq-trading.com/conda/unstable \
      roq-whitebit
$ conda install \
      --channel https://roq-trading.com/conda/stable \
      roq-whitebit

Supports

Products

Spot

✅

Futures

✅

Swap

✅

Option

✅

Orders & Quotes
Account

Funds

✅

Position

✅

Note

✅ = Available.

❎ = Not implemented.

❌ = Unavailable.

❶ = The exchange protocol does not support streaming updates for reference data and market status.

Using

$ roq-whitebit [FLAGS]

Flags

$ roq-whitebit --help
--exchange (whitebit)

Exchange identifier

--api (spot)

API (spot, linear, inverse or option)

--ws_api (false)

Use WebSocket API?

--rest_uri

Exchange end-point

--rest_host

Host (when URI is an IP address)

--rest_proxy

Proxy end-point

--rest_ping_freq (5s)

Ping frequency

--rest_ping_path (/api/v4/public/ping)

Ping path

--rest_request_timeout (30s)

Request timeout

--rest_recv_window (5s)

Receive window (please refer to exchange documentation)

--rest_terminate_on_403 (false)

(TEST) Trigger program termination after receiving a 403 response code?

--rest_back_off_delay (30s)

(TEST) Time to wait before retrying a rejected request

--ws_uri

Exchange end-point

--ws_host

Host (when URI is an IP address)

--ws_ping_freq (30s)

Ping frequency

--ws_request_timeout (15s)

Request timeout

--ws_max_subscriptions_per_stream (100)

Maximum number of symbols per connection

--ws_mbp_depth (0)

Maximum depth

--mbp_allow_price_inversion (false)

Allow price inversion?

--request_limit (10)

Maximum number of requests per interval

--request_limit_interval (1s)

Monitor interval

--encode_buffer_size (1048576)

Encode buffer size

--decode_buffer_size (10485760)

Decode buffer size

Environments

$ --flagfile $CONDA_PREFIX/share/roq-whitebit/flags/prod/flags.cfg
# flagfile for the roq-whitebit gateway

--rest_uri=https://whitebit.com
--ws_uri=wss://api.whitebit.com/ws

Configuration

$ --config_file $CONDA_PREFIX/share/roq-whitebit/config.toml

Important

This template will be replaced when the software is upgraded. Make a copy and modify to your own needs.

# config template for the roq-whitebit gateway

symbols = [
  "^BTCUSD[A-Z]?$",  # spot + linear + inverse
  "^BTC-.*-.*-[PC]$"  # options (e.g. "BTC-26SEP25-300000-P")
]

[accounts]

  [accounts.A1]
  master = true
  login = "YOUR_WHITEBIT_API_KEY_GOES_HERE"
  secret = "YOUR_WHITEBIT_SECRET_GOES_HERE"
  symbols = [ ".*" ]

[users]

  [users.test]
  password = "1234"
  symbols = ".*"

  [users.trader]
  password = "secret"
  accounts = [ "A1" ]
  symbols = [ ".*BTC.*", ".*ETH.*" ]

[rate_limits]

  [rate_limits.global]
    type = "ORDER_ACTION"
    aggregate = true
    request_limit = 100
    monitor_period = "10s"
    ban_period = "5m"

Market Data

Inbound

Enum

PreLaunch

⇒

UNDEFINED

Trading

⇒

OPEN

Settling

⇒

UNDEFINED

Delivering

⇒

UNDEFINED

Closed

⇒

CLOSE

Event

Field

Tickers

highPrice24h

⇒

HIGHEST_TRADED_PRICE

Tickers

lowPrice24h

⇒

LOWEST_TRADED_PRICE

Tickers

lastPrice

⇒

CLOSE_PRICE

Tickers

volume24h

⇒

TRADE_VOLUME

Order Management

Inbound

orderType

Market

⇒

MARKET

Limit

⇒

LIMIT

timeInForce

GTC

⇒

GTC

FOK

⇒

FOK

IOC

⇒

IOC

orderStatus

Created

⇒

WORKING

New

⇒

WORKING

Rejected

⇒

REJECTED

PartiallyFilled

⇒

WORKING

PartiallyFilledCanceled

⇒

CANCELED

Filled

⇒

COMPLETED

Cancelled

⇒

CANCELED

Untriggered

⇒

UNDEFINED

Triggered

⇒

UNDEFINED

Deactivated

⇒

UNDEFINED

Active

⇒

UNDEFINED

Outbound

order_type

execution_instructions

price

stop_price

orderType

price

reduceOnly

MARKET

NaN

NaN

⇒

Market

false

MARKET

DO_NOT_INCREASE

NaN

NaN

⇒

Market

❌

true

LIMIT

✅

NaN

⇒

Limit

✅

false

LIMIT

DO_NOT_INCREASE

✅

NaN

⇒

Limit

✅

true

TBD

TBD

TBD

Comments

  • API market data subscription requires re-subscription of all symbols. This means that new symbol discovery is a very heavy operation.

References

Common

GitHub

Exchange