roq-htx-futures

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

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-htx-futures [FLAGS]

Flags

$ roq-htx-futures --help
--exchange (htx-futures)

Exchange identifier

--api

API (USDT-M-FUTURES, COIN-M-DELIVERY, COIN-M-PERPETUAL)

--ws_api (false)

Use WebSocket API?

--margin_mode

Margin-mode to use when account margin-mode has not been configured

--rest_uri (https://api.hbdm.com)

Exchange end-point

--rest_proxy

Proxy end-point

--rest_ping_freq (5s)

Ping frequency

--rest_ping_path (/api/v1/contract_api_state)

Ping path

--rest_request_timeout (30s)

Request timeout

--rest_listen_key_refresh (1800s)

Listen key refresh period

--rest_order_recv_window (5000ms)

Receive window, please refer to Binance documentation!

--rest_cancel_on_disconnect (false)

Cancel orders on disconnect?

--rest_download_refresh (600s)

Download refresh period

--ws_market_uri (wss://api.hbdm.com/ws)

Exchange end-point

--ws_index_uri (wss://api.hbdm.com/ws_index)

Exchange end-point

--ws_order_uri (wss://api.hbdm.com/notification)

Exchange end-point

--ws_order2_uri (wss://api.hbdm.com/trade)

Exchange end-point

--ws_ping_freq (5s)

Ping frequency

--ws_max_subscriptions_per_stream (32)

Maximum number of symbols per connection

--ws_subscribe_depth_levels (0)

Depth levels

--ws_subscribe_depth_freq (100ms)

Depth update frequency

--ws_subscribe_trade_details (false)

Report individual matches for trade summary? (bool)

--encode_buffer_size (1048576)

Encode buffer size

--decode_buffer_size (10485760)

Decode buffer size

--mbp_allow_price_inversion (false)

Allow price inversion?

Environments

$ --flagfile $CONDA_PREFIX/share/roq-htx-futures/flags/prod/flags-usdt-m-futures.cfg
# flagfile for the roq-htx-futures gateway

--api=usdt-m-futures

--rest_uri=https://api.hbdm.com
--ws_market_uri=wss://api.hbdm.com/linear-swap-ws
--ws_order_uri=wss://api.hbdm.com/linear-swap-notification
--ws_order2_uri=wss://api.hbdm.com/linear-swap-trade
--ws_index_uri=wss://api.hbdm.com/ws_index
$ --flagfile $CONDA_PREFIX/share/roq-htx-futures/flags/prod/flags-coin-m-delivery.cfg
# flagfile for the roq-htx-futures gateway

--api=coin-m-delivery

--rest_uri=https://api.hbdm.com
--ws_market_uri=wss://api.hbdm.com/ws
--ws_order_uri=wss://api.hbdm.com/notification
--ws_order2_uri=wss://api.hbdm.com/trade
--ws_index_uri=wss://api.hbdm.com/ws_index
$ --flagfile $CONDA_PREFIX/share/roq-htx-futures/flags/prod/flags-coin-m-perpetual.cfg
# flagfile for the roq-htx-futures gateway

--api=coin-m-perpetual

--rest_uri=https://api.hbdm.com
--ws_market_uri=wss://api.hbdm.com/swap-ws
--ws_order_uri=wss://api.hbdm.com/swap-notification
--ws_order2_uri=wss://api.hbdm.com/swap-trade
--ws_index_uri=wss://api.hbdm.com/ws_index

Configuration

$ --config_file $CONDA_PREFIX/share/roq-htx-futures/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-htx-futures gateway

symbols = [
  "^BTC-USD[A-Z]?$",  # linear + swap
  "^ETH-USD[A-Z]?$",  # linear + swap
  "^BTC[0-9]{6}$",    # inverse
  "^ETH[0-9]{6}$"     # inverse
]

[accounts]

  [accounts.A1]
  master = true
  login = "YOUR_HTX_FUTURES_API_KEY_GOES_HERE"
  secret = "YOUR_HTX_FUTURES_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

Event

Field

detail

open

OPEN_PRICE

detail

high

HIGHEST_TRADED_PRICE

detail

low

LOWEST_TRADED_PRICE

detail

close

CLOSE_PRICE

detail

vol

TRADE_VOLUME

index

close

INDEX_VALUE

funding_rate

funding_rate

FUNDING_RATE

funding_rate

estimated_rate

FUNDING_RATE_PREDICTION

Order Management

Inbound

Outbound

Comments

  • Symbols are only processed when contract_status==1

  • The channels premium_index and estimated_rate are not available when --api is one of USDT-M-FUTURES, COIN-M-DELIVERY, COIN-M-PERPETUAL.

References

Common

Exchange