roq-ftx#
Links#
Purpose#
Maintain network connectivity with the FTX 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 |
✓ |
Data center located in ap-southeast-1, AWS, Singapore
No test environment
Conda#
$ conda install \
--channel https://roq-trading.com/conda/stable \
roq-ftx
$ cp $CONDA_PREFIX/share/roq-ftx/config.toml $CONFIG_FILE_PATH
# Then modify $CONFIG_FILE_PATH to match your specific configuration
$ roq-ftx \
--name "ftx" \
--config_file "$CONFIG_FILE_PATH" \
--client_listen_address "$UNIX_SOCKET_PATH" \
--metrics_listen_address "$TCP_LISTEN_PORT" \
--flagfile "$FLAG_FILE"
Config#
Flags#
$ roq-ftx --help
|
Number of updates between validating order-book checksum (0 means never validate). |
|
The Logon FIX message can be used to instruct the exchange to automatically cancel all orders if a disconnect has been detected. |
|
Can be used to enable more strict validation of order parameters, e.g. not allowing market orders if using FIX for order entry. Default is to send all order parameters to the exchange for validation. However, this could potentially have an adverse effect on the rate-limiter. |
Environments#
# flagfile
--rest_uri=https://ftx.com
--ws_uri=wss://ftx.com/ws
--fix_uri=tcp+ssl://fix.ftx.com:4363
Market Data#
Event |
Stream |
Messages |
Comments |
---|---|---|---|
MarketData |
markets |
||
MarketData |
markets |
||
MarketData |
ticker |
||
MarketData |
orderbook |
||
Unavailable |
|||
MarketData |
trades |
||
MarketData, Scraper |
markets, futures, future |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
/api/markets, /api/futures |
|
|
DropCopy |
/api/markets, /api/futures |
||
DropCopy |
/api/markets |
Statistics#
Type |
Comments |
---|---|
|
(future) |
|
(future) |
|
(future) |
|
(future) |
|
(future) |
|
(futures) |
Order Management#
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
ExecutionReport (8) |
||
OrderEntry |
ExecutionReport (8) |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
/api/orders, /api/orders/history |
Not implemented |
|
DropCopy |
/api/fills |
Not implemented |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
NewOrderSingle (D) |
||
Unavailable |
|||
OrderEntry |
OrderCancelRequest (F) |
||
OrderEntry |
OrderMassCancelRequest (q) |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
ExecutionReport (8), OrderCancelReject (9), Reject (3) |
Order Types#
Type |
Comments |
---|---|
|
Mapped to |
Time in Force#
Type |
Comments |
---|---|
|
Mapped to |
|
Mapped to |
Position Effect#
Note
Not supported
Execution Instructions#
Type |
Comments |
---|---|
|
Mapped to |
|
Mapped to |
Account Management#
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
/api/account |
||
DropCopy |
/api/wallet/balances |
Streams#
Type |
Comments |
---|---|
FIX |
Primary purpose
Each connection
|
Type |
Comments |
---|---|
REST |
Primary purpose
Each connection
The master account is used to
|
Type |
Comments |
---|---|
WebSocket |
Primary purpose
Each connection
The first stream is used to
|
Constraints#
The gateway requires a master account definition to be functional. This is currently needed by the market data connection.
Rate-limit usage is not communicated by the exchange
Order book
Max depth is 100
Order download doesn’t reveal how many execution reports should arrive
The solution is to make the connection ready some time after the last downloaded execution report has been received
Comments#
Order book
Top-100 checksum is not being verified for latency reasons
Instructions to clear levels appear outside top 100
Order Management
TimeInForce is automatically converted to IOC if order size too small. (More details here.)
Have seen FIX execution reports with pending-cancel arrive after cancel. For this reason, all pending-cancel are dropped.
REST/WS is unreliable at this point. Ordering is a real issue. Also, the automatic conversion to IOC is causing issues because the WS orders channel reports the order to be closed oftentimes followed by a REST response with order details indicating the order is working (new).