roq-fix-bridge¶
Links¶
Purpose¶
Gateway bridge using a FIX 4.4 based message protocol
Integration with third-party vendors
Description¶
The FIX bridge allows FIX clients to connect with gateways, receive market data, and manage orders.
The FIX bridge configuration defines a list of exchanges and corresponding
symbols (regex).
This implementation use exchange
/symbol
for all message
routing!
Note
Some FIX clients may rely on TradingSessionID
for state management.
For many Crypto exchanges, this is not a well-defined concept.
The implementation choice is to use the source_name
of the gateway
(as specified using the gateway --name
command-line flag) to mean
TradingSessionID
.
The concept of TradingSessionID
is otherwise not used directly by
the FIX bridge for any message routing.
The FIX bridge will automatically manage gateway connectivity.
Upon connecting to a gateway, the FIX bridge will discover the universe of
exchange
/symbol
as well as order management capabilities, e.g.
whether order rewrite is supported by a gateway.
Furthermore, a “ready”-state is being maintained based on gateway notifications
around account availability.
Note
FIX clients should expect and manager order action rejects if the
exchange
/symbol
has not yet been discovered and/or the
account is not yet in the ready state (e.g. due to disconnect).
Order management has been implemented to conform to FIX Order State Changes.
This effectively means that ClOrdId
/OrigClOrdId
chaining is
supported when modifying and canceling orders.
When possible, gateways will try to pass enough information to the exchange
such that later order download will be able to notify the FIX bridge with the
correct ClOrdId
/OrigClOrdId
information.
This is however only best effort and the feature should not be relied upon!
Note
The FIX bridge and the gateways are all designed for low latency and there is
no database persistence layer causing latency anywhere in the path of order
routing.
Furthermore, not all exchanges support rewriting client order identifiers.
The FIX bridge and the gateways maintain in-memory maps between exchange
order identifiers and outstanding requests on the one side, and
ClOrdId
/OrigClOrdId
on the other side.
Correct updates around ClOrdId
/OrigClOrdId
chaining should
only be expected if both FIX bridge and gateway remain connected.
Reconnection may work, but it’s best effort, only.
To manage uncertainties around disconnects, the FIX bridge may be configured such that gateways are instructed to auto-cancel orders upon disconnect. Similarly, when possible, gateways may be configured such that exchanges are instructed to auto-cancel orders upon disconnect.
Conda¶
$ mamba install \
--channel https://roq-trading.com/conda/stable \
roq-fix-bridge
$ cp $CONDA_PREFIX/share/roq-fix-bridge/config.toml $CONFIG_FILE_PATH
# Then modify $CONFIG_FILE_PATH to match your specific configuration
$ roq-fix-bridge \
--name "fix-bridge" \
--config_file "$CONFIG_FILE_PATH" \
--service_listen_address "$TCP_LISTEN_PORT_FOR_METRICS" \
--client_listen_address "$TCP_LISTEN_PORT_FOR_FIX_CLIENTS" \
--flagfile "$FLAG_FILE" \
[<gateway unix domain sockets>]
Config¶
A list of exchanges and corresponding symbols.
[symbols]
[symbols.bitmex]
regex=["XBTUSD", "XBT.*"]
[symbols.deribit]
regex=".*"
A list of FIX clients allowed to connect to the FIX bridge.
[users]
[users.MD1]
component="roq-fix-client-test"
username="tbmd1"
An optional list of mapping overrides. This may be necessary because FIX 4.4 has a limited set of market data types (MDEntryType).
[statistics]
[statistics.FUNDING_RATE]
fix_md_entry_type="SETTLEMENT_PRICE"
Flags¶
$ roq-fix-bridge --help
--config_file
Config file
--client_listen_address
Listen address
--cancel_on_disconnect
(false
)Cancel orders on disconnect?
--oms_route_by_strategy
(false
)Route order updates using strategy_id?
--fix_version
(4.4
)FIX version
--fix_comp_id
(roq-fix-bridge
)Component identifier
--fix_auth_method
Authentication method: (empty), hmac_sha256, hmac_sha256_ts
--fix_auth_timestamp_tolerance
(5s
)Timestamp tolerance used with authentication
--fix_logon_timeout
Logon timeout, heartbeat freq is use if not specified
--fix_logon_heartbeat_min
(5s
)Minimum accepted client ping frequency
--fix_logon_heartbeat_max
(60s
)Maximum accepted client ping frequency
--fix_heartbeat_freq
(5s
)Server to client ping frequency
--fix_decode_buffer_size
(1048576
)Decode buffer size
--fix_encode_buffer_size
(10485760
)Encode buffer size
--fix_md_full_size
(262144
)Pre-allocate
--fix_md_inc_size
(262144
)Pre-allocate
--fix_sec_list_grp_size
(32768
)Pre-allocate
--fix_bids_asks_size
(262144
)Pre-allocate
--fix_debug
(false
)Debug fix messages?
--fix_log_path
Filename for logging fix messages
--fix_disable_req_id_validation
(false
)Disable request ID validation?
--init_missing_md_entry_type_to_zero
(false
)Initialize missing MDEntryType to zero?
--execution_report_using_base_currency
(false
)Use base currency for execution report?
--exchange_time_as_sending_time
(false
)Use exchange time for sending time (tag 52)?
--top_of_book_from_market_by_price
(false
)Use market by price as the source for top of book?
--block_client_on_not_ready
(false
)Block client from logon when account not ready?
--terminate_on_timeout
(false
)Terminate on order-ack timeout?
--terminate_on_stream_disconnect
(false
)Terminate on stream disconnect?
--terminate_on_disconnect
(false
)Terminate on gateway disconnect?
--silence_non_final_order_ack
(false
)Silently drop non-final order-ack’s?
--skip_order_download
(false
)Skip downloaded orders?
--disconnect_client_on_stale_market_data_stream
(false
)Disconnect client(s) when market data streams are disconnected?
--trade_summary_try_non_empty
(false
)Test #1
--trade_summary_try_value
(0
)Test #2
--strict_checking
(false
)Hard failure on assertions
--test_md_entry_position_no
(false
)Populate md_entry_position_no? (only for limited depth)
--test_default_decimal_digits
(12
)Default number of decimals
--test_request_latency
(false
)Log request round-trip latencies?
Session¶
Client → Server¶
This message must be the first message sent by a connecting client session and is used to authenticate that client. See Authentication for further details.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
98 |
EncryptMethod |
Only |
|
✓ |
108 |
HeartBtInt |
||
96 |
RawData |
See Authentication for further details. |
||
141 |
ResetSeqNumFlag |
Only |
||
553 |
Username |
See Authentication for further details. |
||
554 |
Password |
See Authentication for further details. |
This message can be used by either side to initiate orderly session shutdown. The other side should respond with a Logout
(5
) message and then disconnect.
Tag |
Name |
Comments |
||
---|---|---|---|---|
58 |
Text |
This message can be sent by either side to verify the connection. The frequency must have been communicated through the Logon
(A
) messages.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
112 |
TestReqId |
Either side must send this message as a response to a received TestRequest
(1
) message.
Tag |
Name |
Comments |
||
---|---|---|---|---|
112 |
TestReqId |
Value must be copied from a received |
Either side may send this message when a session-level rule has been violated.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
45 |
RefSeqNum |
||
58 |
Text |
|||
371 |
RefTagID |
|||
372 |
RefMsgType |
|||
373 |
SessionRejectReason |
Server → Client¶
This message is used to acknowledge successful authentication.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
98 |
EncryptMethod |
Only |
|
✓ |
108 |
HeartBtInt |
This message can be used by either side to initiate orderly session shutdown. The other side should respond with a Logout
(5
) message and then disconnect.
Tag |
Name |
Comments |
||
---|---|---|---|---|
58 |
Text |
Reason for the logout. |
This message can be sent by either side to verify the connection. The frequency must have been communicated through the Logon
(A
) messages.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
112 |
TestReqId |
Value to be echoed. |
Either side must send this message as a response to a received TestRequest
(1
) message.
Tag |
Name |
Comments |
||
---|---|---|---|---|
112 |
TestReqId |
Value is copied from a received |
Either side may send this message when a session-level rule has been violated.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
45 |
RefSeqNum |
Sequence number causing the reject. |
|
58 |
Text |
Reason for the reject. |
||
371 |
RefTagID |
Tag causing the reject. |
||
372 |
RefMsgType |
Message causing the reject. |
||
373 |
SessionRejectReason |
Market Data¶
Client → Server¶
This message is used the request a list of securities.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
320 |
SecurityReqId |
See Request ID’s for further details. |
|
✓ |
559 |
SecurityListRequestType |
Only |
|
55 |
Symbol |
|||
207 |
SecurityExchange |
|||
263 |
SubscriptionRequestType |
Possible values
|
This message is used to request a security definition.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
320 |
SecurityReqId |
See Request ID’s for further details. |
|
✓ |
321 |
SecurityRequestType |
Unused. |
|
55 |
Symbol |
|||
207 |
SecurityExchange |
|||
263 |
SubscriptionRequestType |
Only |
This message is used to request current trading status for a security.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
324 |
SecurityStatusReqId |
See Request ID’s for further details. |
|
✓ |
55 |
Symbol |
||
✓ |
207 |
SecurityExchange |
||
✓ |
263 |
SubscriptionRequestType |
Only |
This message is used to request market data.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
262 |
MdReqId |
See Request ID’s for further details. |
|
✓ |
263 |
SubscriptionRequestType |
Possible values
|
|
264 |
MarketDepth |
|||
265 |
MDUpdateType |
Only |
||
266 |
AggregatedBook |
|||
✓ |
267 |
NoMdEntryTypes |
||
✓ |
⇒ |
269 |
MDEntryType |
|
✓ |
146 |
NoRelatedSym |
||
✓ |
⇒ |
55 |
Symbol |
|
✓ |
⇒ |
207 |
SecurityExchange |
This message is used the request market status.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
335 |
TradSesReqID |
See Request ID’s for further details. |
|
336 |
TradingSessionID |
|||
✓ |
263 |
SubscriptionRequestType |
Only |
Server → Client¶
This message is a response to SecurityListRequest
(x
)
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
320 |
SecurityReqId |
||
✓ |
322 |
SecurityResponseID |
||
✓ |
560 |
SecurityRequestResult |
Possible values
|
|
✓ |
146 |
NoRelatedSym |
||
✓ |
⇒ |
55 |
Symbol |
|
✓ |
⇒ |
207 |
SecurityExchange |
This message is a reponse to SecurityDefinitionRequest
(c
)
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
320 |
SecurityReqId |
||
✓ |
322 |
SecurityResponseID |
||
✓ |
323 |
SecurityResponseType |
Possible values
|
|
55 |
Symbol |
|||
231 |
ContractMultiplier |
|||
207 |
SecurityExchange |
|||
336 |
TradingSessionID |
|||
562 |
MinTradeVol |
|||
969 |
MinPriceIncrement |
This message is a reponse to SecurityStatusRequest
(e
)
Tag |
Name |
Comments |
||
---|---|---|---|---|
324 |
SecurityStatusReqID |
|||
✓ |
55 |
Symbol |
||
✓ |
207 |
SecurityExchange |
||
336 |
TradingSessionID |
|||
326 |
SecurityTradingStatus |
This message is used for snapshot when market data have been requested.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
262 |
MDReqID |
||
✓ |
55 |
Symbol |
||
✓ |
207 |
SecurityExchange |
||
✓ |
268 |
NoMdEntries |
||
✓ |
⇒ |
269 |
MDEntryType |
Possible values
|
✓ |
⇒ |
270 |
MDEntryPx |
|
✓ |
⇒ |
271 |
MDEntrySize |
|
⇒ |
272 |
MDEntryDate |
||
⇒ |
273 |
MDEntryTime |
||
⇒ |
336 |
TradingSessionID |
||
⇒ |
346 |
NumberOfOrders |
||
⇒ |
290 |
MDEntryPositionNo |
This message is used for incremental updates when market data have been subscribed.
Tag |
Name |
Comments |
||
---|---|---|---|---|
262 |
MdReqId |
|||
✓ |
268 |
NoMdEntries |
||
✓ |
⇒ |
279 |
MDUpdateAction |
Possible values
|
✓ |
⇒ |
269 |
MDEntryType |
Possible values
|
⇒ |
55 |
Symbol |
||
⇒ |
207 |
SecurityExchange |
||
✓ |
⇒ |
270 |
MDEntryPx |
|
⇒ |
271 |
MDEntrySize |
||
⇒ |
272 |
MDEntryDate |
||
⇒ |
273 |
MDEntryTime |
||
⇒ |
336 |
TradingSessionID |
||
⇒ |
346 |
NumberOfOrders |
||
⇒ |
290 |
MDEntryPositionNo |
This message is the response to MarketDataRequest
(V
) when the request can not be honored.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
262 |
MDReqID |
||
✓ |
281 |
MDReqRejReason |
Possible values
|
|
58 |
Text |
Reason for reject. |
This message is a response to TradingSessionRequest
(g
).
Tag |
Name |
Comments |
||
---|---|---|---|---|
335 |
TradSesReqID |
|||
✓ |
336 |
TradingSessionID |
||
340 |
TradSesStatus |
|||
567 |
TradSesStatusRejReason |
Only sent with reject and then always |
||
58 |
Text |
Reason for reject. |
Order Management¶
Client → Server¶
This message is used to request order status.
Tag |
Name |
Comments |
||
---|---|---|---|---|
37 |
OrderID |
|||
11 |
ClOrdID |
See Request ID’s for further details. |
||
453 |
NoPartyIDS |
See Routing for further details. |
||
⇒ |
448 |
PartyID |
Strategy ID. |
|
⇒ |
447 |
PartyIDSource |
Only |
|
⇒ |
452 |
PartyRole |
Only |
|
790 |
OrdStatusReqID |
See Request ID’s for further details. |
||
1 |
Account |
|||
✓ |
55 |
Symbol |
||
✓ |
207 |
SecurityExchange |
||
✓ |
54 |
Side |
This message is used to request the status of orders matching the filters.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
584 |
MassStatusReqID |
See Request ID’s for further details. |
|
✓ |
585 |
MassStatusReqType |
Possible values
|
|
453 |
NoPartyIDS |
See Routing for further details. |
||
⇒ |
448 |
PartyID |
Strategy ID. |
|
⇒ |
447 |
PartyIDSource |
Only |
|
⇒ |
452 |
PartyRole |
Only |
|
1 |
Account |
|||
336 |
TradingSessionID |
|||
55 |
Symbol |
|||
207 |
SecurityExchange |
|||
54 |
Side |
This message is used to send an order request.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
11 |
ClOrdID |
See Request ID’s for further details. |
|
453 |
NoPartyIDS |
See Routing for further details. |
||
⇒ |
448 |
PartyID |
Strategy ID. |
|
⇒ |
447 |
PartyIDSource |
Only |
|
⇒ |
452 |
PartyRole |
Only |
|
1 |
Account |
|||
18 |
ExecInst |
|||
✓ |
55 |
Symbol |
||
✓ |
207 |
SecurityExchange |
||
✓ |
54 |
Side |
||
✓ |
60 |
TransactTime |
||
✓ |
38 |
OrderQty |
||
✓ |
40 |
OrdType |
||
44 |
Price |
|||
99 |
StopPx |
|||
59 |
TimeInForce |
|||
58 |
Text |
See Parameters for further details. |
||
77 |
PositionEffect |
|||
210 |
MaxShow |
This message is used to cancel an order.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
41 |
OrigClOrdID |
See Request ID’s for further details. |
|
37 |
OrderID |
|||
✓ |
11 |
ClOrdID |
See Request ID’s for further details. |
|
1 |
Account |
|||
453 |
NoPartyIDS |
See Routing for further details. |
||
⇒ |
448 |
PartyID |
Strategy ID. |
|
⇒ |
447 |
PartyIDSource |
Only |
|
⇒ |
452 |
PartyRole |
Only |
|
✓ |
55 |
Symbol |
||
✓ |
207 |
SecurityExchange |
||
✓ |
54 |
Side |
||
✓ |
60 |
TransactTime |
||
✓ |
38 |
OrderQty |
This message is used to modify an order.
Tag |
Name |
Comments |
||
---|---|---|---|---|
37 |
OrderID |
|||
453 |
NoPartyIDS |
See Routing for further details. |
||
⇒ |
448 |
PartyID |
Strategy ID. |
|
⇒ |
447 |
PartyIDSource |
Only |
|
⇒ |
452 |
PartyRole |
Only |
|
✓ |
41 |
OrigClOrdID |
See Request ID’s for further details. |
|
✓ |
11 |
ClOrdID |
See Request ID’s for further details. |
|
1 |
Account |
|||
✓ |
55 |
Symbol |
||
✓ |
207 |
SecurityExchange |
||
38 |
OrderQty |
Some exchanges only accept quantity or price. This field is therefore not required. |
||
44 |
Price |
|||
✓ |
54 |
Side |
||
✓ |
60 |
TransactTime |
||
✓ |
40 |
OrdType |
This message is used to cancel orders.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
11 |
ClOrdID |
See Request ID’s for further details. |
|
✓ |
530 |
MassCancelRequestType |
Possible values
|
|
55 |
Symbol |
|||
207 |
SecurityExchange |
|||
54 |
Side |
|||
✓ |
60 |
TransactTime |
||
453 |
NoPartyIDS |
See Routing for further details. |
||
⇒ |
448 |
PartyID |
Strategy ID. |
|
⇒ |
447 |
PartyIDSource |
Only |
|
⇒ |
452 |
PartyRole |
Only |
Server → Client¶
This message is used to report current status of an order.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
37 |
OrderID |
||
11 |
ClOrdID |
|||
41 |
OrigClOrdID |
|||
790 |
OrdStatusReqID |
|||
584 |
MassStatusReqID |
|||
911 |
TotNumReports |
|||
912 |
LastRptRequested |
|||
453 |
NoPartyIDS |
See Routing for further details. |
||
⇒ |
448 |
PartyID |
Strategy ID. |
|
⇒ |
447 |
PartyIDSource |
Only |
|
⇒ |
452 |
PartyRole |
Only |
|
✓ |
17 |
ExecID |
||
✓ |
150 |
ExecType |
||
✓ |
39 |
OrdStatus |
||
636 |
WorkingIndicator |
|||
103 |
OrdRejReason |
|||
1 |
Account |
|||
581 |
AccountType |
|||
✓ |
55 |
Symbol |
||
✓ |
207 |
SecurityExchange |
||
✓ |
54 |
Side |
||
40 |
OrdType |
|||
38 |
OrderQty |
|||
44 |
Price |
|||
99 |
StopPx |
|||
15 |
Currency |
|||
59 |
TimeInForce |
|||
18 |
ExecInst |
|||
32 |
LastQty |
|||
31 |
LastPx |
|||
✓ |
151 |
LeavesQty |
||
✓ |
14 |
CumQty |
||
✓ |
6 |
AvgPx |
||
60 |
TransactTime |
|||
77 |
PositionEffect |
|||
210 |
MaxShow |
|||
58 |
Text |
|||
851 |
LastLiquidityInd |
This message is used when an order cancel request must be rejected.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
37 |
OrderID |
||
✓ |
11 |
ClOrdID |
||
✓ |
41 |
OrigClOrdID |
||
39 |
OrdStatus |
|||
1 |
Account |
|||
434 |
CxlRejResponseTo |
Possible values
|
||
102 |
CxlRejReason |
Possible values
|
||
58 |
Text |
Reason for reject. |
This message is used to acknowledge a request to cancel orders.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
11 |
ClOrdID |
||
✓ |
37 |
OrderID |
||
✓ |
530 |
MassCancelRequestType |
||
✓ |
531 |
MassCancelResponse |
||
532 |
MassCancelRejectReason |
|||
55 |
Symbol |
|||
207 |
SecurityExchange |
|||
54 |
Side |
|||
58 |
Text |
Reason for reject. |
||
453 |
NoPartyIDS |
See Routing for further details. |
||
⇒ |
448 |
PartyID |
Strategy ID. |
|
⇒ |
447 |
PartyIDSource |
Only |
|
⇒ |
452 |
PartyRole |
Only |
Trade Reporting¶
Client → Server¶
This message is used to request trade capture reports.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
568 |
TradeRequestID |
See Request ID’s for further details. |
|
✓ |
569 |
TradeRequestType |
||
263 |
SubscriptionRequestType |
Possible values
|
||
37 |
OrderID |
|||
11 |
ClOrdID |
See Request ID’s for further details. |
||
453 |
NoPartyIDS |
See Routing for further details. |
||
⇒ |
448 |
PartyID |
Strategy ID. |
|
⇒ |
447 |
PartyIDSource |
Only |
|
⇒ |
452 |
PartyRole |
Only |
|
55 |
Symbol |
|||
207 |
SecurityExchange |
Server → Client¶
This message is used to report captured trade.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
571 |
TradeReportID |
||
568 |
TradeRequestID |
|||
150 |
ExecType |
|||
748 |
TotNumTradeReports |
|||
912 |
LastRptRequested |
|||
17 |
ExecID |
|||
✓ |
570 |
PreviouslyReported |
||
✓ |
55 |
Symbol |
||
✓ |
207 |
SecurityExchange |
||
✓ |
32 |
LastQty |
||
✓ |
31 |
LastPx |
||
✓ |
75 |
TradeDate |
||
✓ |
60 |
TransactTime |
||
✓ |
552 |
NoSides |
||
✓ |
⇒ |
54 |
Side |
|
✓ |
⇒ |
37 |
OrderID |
|
⇒ |
11 |
ClOrdID |
||
⇒ |
453 |
NoPartyIDS |
See Routing for further details. |
|
⇛ |
448 |
PartyID |
Strategy ID. |
|
⇛ |
447 |
PartyIDSource |
Only |
|
⇛ |
452 |
PartyRole |
Only |
|
⇒ |
1 |
Account |
||
⇒ |
77 |
PositionEffect |
Response
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
568 |
TradeRequestID |
||
✓ |
569 |
TradeRequestType |
||
✓ |
749 |
TradeRequestResult |
||
✓ |
750 |
TradeRequestStatus |
||
✓ |
55 |
Symbol |
||
✓ |
207 |
SecurityExchange |
||
58 |
Text |
Position Management¶
Client → Server¶
This message is used to request position reports.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
710 |
PosReqId |
See Request ID’s for further details. |
|
✓ |
724 |
PosReqType |
Only |
|
263 |
SubscriptionRequestType |
Possible values
|
||
✓ |
453 |
NoPartyIDS |
See Routing for further details. |
|
⇒ |
448 |
PartyID |
Strategy ID. |
|
⇒ |
447 |
PartyIDSource |
Only |
|
⇒ |
452 |
PartyRole |
Only |
|
✓ |
1 |
Account |
||
✓ |
581 |
AccountType |
||
15 |
Currency |
|||
55 |
Symbol |
|||
207 |
SecurityExchange |
|||
✓ |
715 |
ClearingBusinessDate |
||
✓ |
60 |
TransactTime |
Server → Client¶
This message is used to report position updates.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
721 |
PosMaintRptID |
||
710 |
PosReqID |
|||
724 |
PosReqType |
Always |
||
263 |
SubscriptionRequestType |
|||
727 |
TotalNumPosReports |
|||
✓ |
728 |
PosReqResult |
Always |
|
✓ |
715 |
ClearingBusinessDate |
||
453 |
NoPartyIDS |
See Routing for further details. |
||
⇒ |
448 |
PartyID |
Strategy ID. |
|
⇒ |
447 |
PartyIDSource |
Only |
|
⇒ |
452 |
PartyRole |
Only |
|
✓ |
1 |
Account |
||
✓ |
581 |
AccountType |
||
✓ |
55 |
Symbol |
||
207 |
SecurityExchange |
|||
15 |
Currency |
|||
✓ |
730 |
SettlPrice |
||
✓ |
731 |
SettlPriceType |
||
✓ |
734 |
PriorSettlPrice |
||
702 |
NoPositions |
|||
✓ |
⇒ |
703 |
PosType |
|
753 |
NoPosAmt |
|||
58 |
Text |
Miscellaneous¶
Server → Client¶
Either side may send this message when an application-level rule has been violated and there are no specific messages available to cmmunicate the failure.
Tag |
Name |
Comments |
||
---|---|---|---|---|
✓ |
45 |
RefSeqNum |
Sequence number causing the reject. |
|
✓ |
372 |
RefMsgType |
Message causing the reject. |
|
✓ |
379 |
BusinessRejectRefID |
Request ID (message specific). |
|
✓ |
380 |
BusinessRejectReason |
||
✓ |
58 |
Text |
Reason for the reject. |
Authentication¶
The simplest version is plain comparison on the password string.
hmac_sha256
¶
The connecting client must compute a nonce and pass this as Logon.raw_data
.
A signature is the base64 encoding of the HMAC/SHA256 digest (using a shared secret).
The connecting client must pass this as Logon.password
.
hmac_sha256_ts
¶
This is the same algorithm as hmac_sha256
with the only difference being
a millisecond timestamp and a period (.
) being prepended to the nonce.
The server side can then extract the timestamp and validate against its own clock.
Request ID’s¶
Must conform to the character set from web-safe base 64 encoding (
a-zA-Z0-9-_{1,24}
).
Routing¶
The bridge can operate in one of two modes.
Default is routing by account.
Routing by strategy can be enabled by using the --oms_route_by_strategy
flag.
Party information is then required and expected to identify the strategy.
Parameters¶
It is possible to use the text field to pass additional parameters.
For example, the NewOrderSingle
request may optionally accept a
specific margin_mode
.
These parameters are key value pairs,
each pair using the assignment operator (=
) to separate key and value,
pairs separated by semi-colon (code:;).
Enums¶
The following defines the maximum set of values allowed. Exchanges / gateways may impose further restrictions.
Side <54>¶
1
(BUY
)2
(SELL
)
TimeInForce <59>¶
0
(GFD
)1
(GTC
)2
(OPG
)3
(IOC
)4
(FOK
)5
(GTX
)6
(GTD
)7
(AT_THE_CLOSE
)8
(GOOD_THROUGH_CROSSING
)9
(AT_CROSSING
)A
(GOOD_FOR_TIME
)
PositionEffect <77>¶
C
(CLOSE
)O
(OPEN
)
ExecInst <18>¶
6
(PARTICIPATE_DO_NOT_INITIATE
)E
(DO_NOT_INCREASE
)F
(DO_NOT_REDUCE
)Z
(CANCEL_IF_NOT_BEST
)
Constraints¶
The bridge must register as a regular user to the gateways. The implication is that the bridge only has visibility to that user, i.e. there is no option to see the orders managed by other users. Thus, there is currently no option to implement a true drop-copy solution.
The bridge requires each downstream client to be mapped 1:1 with an account. This is currently the only option to route order acks, order updates and trades back to the correct client. Note! The C++ API does support account multiplexing.
The universe of {exchange, symbol} is dynamic and can not always be known at the time when a FIX client issues a request. The FIX protocol also does not allow for a client to receive notifications when an exchange hase become ready. Thus, a FIX client must expect rejects (when an {exchange, symbol} combination has not yet become available, for example) and implement a retry policy.
Successful FIX client subscriptions will be cached and survive gateway reconnects. This is done because the FIX protocol does not allow for a client to receive notifications when a subscription is broken. Thus, a FIX client must expect stale subscriptions and implement a timeout policy.
The FIX protocol requires subsequent order actions to be rejected if a previous request has been rejected. Full support is only possible if the exchanges support it or if the gateways disallow pipelining (sending multiple requests without first waiting for the previous request’s response). A low-latency configuration should allow pipelining (at the gateway level) and the FIX bridge can therefore not be fully FIX compliant (for the reasons just described).
Custom order book calculations are supported but constrained to one custom calculation per market data request. It is not possible to overlap custom calculations with regular updates (like top of book or market by price) due to the FIX protocol allowing for any other special identifiers with the full/incremental updates.
Comments¶
The bridge can operate in one of two modes:
Routing by
account
(the default). In this mode a client connection must map 1:1 with an account. All order updates will be routed based on the account name.Routing by
strategy_id
(opt-in, used byroq-fix-proxy
). In this mode a client connection must dynamically register routes based onstrategy_id
’s. The route is automatically removed upon seeing the client disconnecting. All order updates will be routed based on the strategy.It is possible to use
NewOrderSingle.text
to map special fields, e.g.margin_mode=isolated
margin_mode=cross
Note
This is currently an EXPERIMENTAL feature meant to work around FIX protocol limitations. Choices around the format (key-value pairs, separator, naming conventions, etc.) may still be changed.