roq-bitmex#
Links#
Purpose#
Maintain network connectivity with the BitMEX exchange
Route exchange updates to connected clients
Route client requests to the relevant exchange accounts
Stream all messages to an event-log
Overview#
Products
Spot |
✓ |
Futures |
✓ |
Options |
Market Data
Reference Data |
✓ |
Market Status |
✓ |
Top of Book |
✓ |
Market by Price (L2) |
✓ |
Market by Order (L3) |
|
Trade Summary |
✓ |
Statistics |
✓ |
Order Management
Create |
✓ |
Modify |
✓ |
Cancel |
✓ |
Cancel All |
✓ |
Auto Cancellation |
Account Management
Positions |
✓ |
Funds |
Conda#
$ mamba install \
--channel https://roq-trading.com/conda/stable \
roq-bitmex
$ cp $CONDA_PREFIX/share/roq-bitmex/config.toml $CONFIG_FILE_PATH
# Then modify $CONFIG_FILE_PATH to match your specific configuration
$ roq-bitmex \
--name "bitmex" \
--config_file "$CONFIG_FILE_PATH" \
--client_listen_address "$UNIX_SOCKET_PATH" \
--service_listen_address "$TCP_LISTEN_PORT" \
--flagfile "$FLAG_FILE"
Config#
Flags#
$ roq-bitmex --help
|
The Warning Do not rely on this feature: we have not been able to verify it works correctly! |
|
Only used when |
|
DEVELOPMENT !!! Choose REST or WebSocket for order management. Warning DO NOT USE !!! This is currently in development without having access to the exchange’s API (as it has not been released yet). |
Environments#
# flagfile
--rest_uri=https://www.bitmex.com
--ws_uri=wss://ws.bitmex.com/realtime
# flagfile
--rest_uri=https://testnet.bitmex.com
--ws_uri=wss://ws.testnet.bitmex.com/realtime
Market Data#
Event |
Stream |
Messages |
Comments |
---|---|---|---|
MarketData |
instrument |
||
MarketData |
instrument |
||
MarketData |
quote |
||
MarketData |
orderBookL2 |
||
Unavailable |
|||
MarketData |
trade |
||
MarketData |
instrument |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Statistics#
Type |
Comments |
---|---|
|
(instrument) |
|
(instrument) |
|
(instrument) |
|
(instrument) |
|
(instrument) |
|
(instrument) |
|
(funding) |
|
(funding) |
Order Management#
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
execution |
||
DropCopy |
execution |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
GET /api/v1/order |
||
OrderEntry |
GET /api/v1/trade |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
POST /api/v1/order |
||
OrderEntry |
PUT /api/v1/order |
||
OrderEntry |
DELETE /api/v1/order |
||
OrderEntry |
DELETE /api/v1/order/all |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
/api/v1/order |
Errors, only |
Order Types#
Type |
Comments |
---|---|
|
Mapped to |
|
Mapped to |
Time in Force#
Type |
Comments |
---|---|
|
Mapped to |
Position Effect#
Note
Not supported
Execution Instructions#
Type |
Comments |
---|---|
|
Mapped to |
|
Mapped to |
Account Management#
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
position |
||
Unavailable |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
GET /api/v1/position |
||
Unavailable |
Streams#
Type |
Comments |
---|---|
REST |
Primary purpose
Each connection
Rate-limit avoidance is implemented by
|
Type |
Comments |
---|---|
WebSocket |
Primary purpose
Each connection
|
Type |
Comments |
---|---|
WebSocket |
Primary purpose
A single connection |
Constraints#
The field
clOrdID
is a string and can not exceed 36 characters
Comments#
The exchange API’s do not appear particularly suitable for low latency trading:
Order action requests must be signed (which is expensive) and then sent over REST
REST response (order ack) could be lost possibly leaving the client in a situation where it must trigger timeout logic and/or issue operational alerts
Several WebSocket channels are used communicate order state possibly allowing for inconsistent order management by client