roq-hitbtc

Supports

Products

Spot

Futures

Options

Combos

Market Data

Reference Data

Market Status

Top of Book

Market by Price

Market by Order

Trade Summary

Statistics

Order Management

Create

Modify

Cancel

Cancel All

Auto-Cancel

Account Management

Positions

Funds

Installing

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

Using

$ roq-hitbtc \
      --name "hitbtc" \
      --config_file $CONFIG_FILE_PATH \
      --client_listen_address $UNIX_SOCKET_PATH \
      --flagfile $ENVIRONMENT_FLAGFILE

Flags

$ roq-hitbtc --help
--exchange (hitbtc)

Exchange identifier

--ws_uri (wss://api.hitbtc.com/api/2/ws)

Exchange end-point

--ws_ping_freq (5s)

Ping frequency

--ws_request_timeout (15s)

Request timeout

--ws_max_subscriptions_per_stream (256)

Maximum number of symbols per connection

--encode_buffer_size (1048576)

Encode buffer size

--decode_buffer_size (10485760)

Decode buffer size

--mbp_allow_price_inversion (false)

Allow price inversion?

Environments

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

--rest_uri=https://api.hitbtc.com
--ws_uri=wss://api.hitbtc.com/api/2/ws
$ $CONDA_PREFIX/share/roq-hitbtc/flags/test/flags.cfg
# flagfile for the roq-hitbtc gateway

--rest_uri=https://api.demo.hitbtc.com
--ws_uri=wss://api.demo.hitbtc.com/api/2/ws

Configuration

$ $CONDA_PREFIX/share/roq-hitbtc/config.toml

Important

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

symbols = [
  "^BTCUSD[A-Z]?$",
  "^ETHUSD[A-Z]?$"
]

[accounts]

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

Event

Stream

Messages

Comments

roq::ReferenceData

MarketData

getSymbols

Polling

roq::MarketStatus

Unavailable

roq::TopOfBook

MarketData

subscribeTicker, ticker

roq::MarketByPriceUpdate

MarketData

subscribeOrderbook, snapshotOrderbook, updateOrderbook

roq::MarketByOrderUpdate

Unavailable

roq::TradeSummary

MarketData

subscribeTrades, snapshotTrades, updateTrades

roq::StatisticsUpdate

MarketData

subscribeTicker, ticker

Statistics

Order Management

Event

Stream

Messages

Comments

roq::OrderUpdate

DropCopy

activeOrders, report

roq::TradeUpdate

DropCopy

report

Event

Stream

Messages

Comments

roq::OrderUpdate

Rest

GET /api/2/history/order

roq::TradeUpdate

Rest

GET /api/2/history/trades

Event

Stream

Messages

Comments

roq::CreateOrder

OrderEntry

newOrder

roq::ModifyOrder

OrderEntry

cancelReplaceOrder

roq::CancelOrder

OrderEntry

cancelOrder

roq::CancelAllOrders

Unavailable

Event

Stream

Messages

Comments

roq::OrderAck

OrderEntry

result, error

Order Types

TBD

Time in Force

TBD

Position Effect

TBD

Execution Instructions

TBD

Account Management

Event

Stream

Messages

Comments

roq::PositionUpdate

roq::FundsUpdate

Event

Stream

Messages

Comments

roq::PositionUpdate

Unavailable

roq::FundsUpdate

OrderEntry

getTradingBalance

Polling

Streams

Type

Comments

WebSocket

Primary purpose

  • support order management

Each connection

  • supports a single account

Type

Comments

WebSocket

Primary purpose

  • support account management

Each connection

  • supports a single account

Type

Comments

WebSocket

Primary purpose

  • live market data

Each connection

  • supports a slice of the symbols

Type

Comments

REST

Primary purpose

  • download order history

Each connection

  • supports a single account

Constraints

  • Rate-limit usage is not communicated by the exchange

Comments

The advertised FIX API does not appear to actually exist. This is the response we received from support: “At the moment, we do not grant FIX access to users”.