roq-huobi-futures¶
Links¶
Supports¶
Spot |
|
Futures |
✓ |
Options |
|
Combos |
Reference Data |
✓ |
Market Status |
|
Top of Book |
✓ |
Market by Price |
✓ |
Market by Order |
|
Trade Summary |
✓ |
Statistics |
✓ |
Create |
✓ |
Modify |
|
Cancel |
✓ |
Cancel All |
✓ |
Auto-Cancel |
Positions |
✓ |
Funds |
✓ |
Installing¶
$ mamba install \
--channel https://roq-trading.com/conda/stable \
roq-huobi-futures
$ mamba install \
--channel https://roq-trading.com/conda/unstable \
roq-huobi-futures
Using¶
$ roq-huobi-futures \
--name "huobi-futures" \
--config_file $CONFIG_FILE_PATH \
--client_listen_address $UNIX_SOCKET_PATH \
--flagfile $ENVIRONMENT_FLAGFILE
Flags¶
$ roq-huobi-futures --help
--exchange
(huobi-futures
)Exchange identifier
--api
API (<empty>,
swap
,linear-swap
)
--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_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¶
$ $CONDA_PREFIX/share/roq-huobi-futures/flags/prod/flags.cfg
# flagfile for the roq-huobi-futures gateway
--rest_uri=https://api.hbdm.com
--ws_market_uri=wss://api.hbdm.com/ws
--ws_order_uri=wss://api.hbdm.com/notification
--ws_index_uri=wss://api.hbdm.com/ws_index
$ $CONDA_PREFIX/share/roq-huobi-futures/flags/prod/flags-swap.cfg
# flagfile for the roq-huobi-futures gateway
--api=swap
--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_index_uri=wss://api.hbdm.com/ws_index
$ $CONDA_PREFIX/share/roq-huobi-futures/flags/prod/flags-linear-swap.cfg
# flagfile for the roq-huobi-futures gateway
--api=linear-swap
--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_index_uri=wss://api.hbdm.com/ws_index
Configuration¶
$ $CONDA_PREFIX/share/roq-huobi-futures/config.toml
Important
The template will be replaced when the software is upgraded. Make a copy and modify to your needs.
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_HUOBI_FUTURES_API_KEY_GOES_HERE"
secret = "YOUR_HUOBI_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¶
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
public.$symbol.contract_info |
Requires authentication. |
|
MarketData |
market.$symbol.bbo |
||
MarketData |
market.$symbol.depth.size_150.high_freq |
||
MarketData |
market.$symbol.trade.detail |
||
MarketData |
market.$symbol.detail, market.$symbol.estimated_rate.1min, market.$symbol.premium_index.1min, public.$symbol.funding_rate |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Rest |
/api/v1/contract_contract_info, /linear-swap-api/v1/swap_contract_info |
||
Statistics¶
Type |
Comments |
---|---|
|
(detail) open |
|
(detail) high |
|
(detail) low |
|
(detail) close |
|
(detail) vol |
|
(funding_rate) funding_rate |
|
(funding_rate) estimated_rate |
|
(index) close |
Order Management¶
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Order Types¶
TBD
Time in Force¶
TBD
Position Effect¶
TBD
Execution Instructions¶
TBD
Account Management¶
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Streams¶
Type |
Comments |
---|---|
REST |
Primary purpose |
Comments¶
Symbols are only processed when
contract_status==1
The channels
premium_index
andestimated_rate
are not available when--api
isinverse
(or missing, the default).