This page sets out the key aspects of establishing and managing sessions between the MFSBE4 client and the Whisperer Feed Handler. In addition details are provided setting out how to initiate or terminate connectivity to the target Venue.
Overview
Sessions
Session Types
Whisperer SBE4 Maintains the following session types:
- Pricing
- Delivery of Market Data from a CLOB Venue
- ESP mass-quotes from a Maker MFSBE4 client to a Taker Venue.
- ESP mass-quotes from a Maker Venue to a Taker MFSBE4 client.
- Orders
- Submission and execution of MFSBE4 client orders against a CLOB Venue.
- Orders against ESP liquidity (published on a separate Pricing session) from a Taker Venue to a Maker MFSBE4 client.
- Orders against ESP liquidity (published on a separate Pricing session) from a Taker MFSBE4 client to a Maker Venue.
- RFS
- Full RFS/RFQ quotation negotiation life cycle between Maker MFSBE4 client and Taker Venue.
- Full RFS/RFQ quotation negotiation life cycle between Taker MFSBE4 client and Maker Venue.
- DropCopy
- Delivery of post-Trade Straight-Through Processing (STP) trade notifications. Typically this will be restricted to notifications from dedicated Venue API connections only.
For a given Client and given Whisperer Feed Handler deployment within MarketFactory, each session type will be assigned unique Venue connection credentials (typically TargetCompID and SenderCompID).
24x5.5 Availability
All session types are maintained directly with an individual Whisperer Feed Handler. All Feed Handlers are available 24 x 5.5 - the full trading week commencing on Sunday prior to Asia-open and ending on Friday, NY-close, irrespective of the schedule of the Venue itself.
Message Header
In addition to the default SBE message header fields (blockLength, templateId, schemaId and version), the MFSBE4 header additionally defines the mandatory population of the following fields:
- messageLength - this is provided to allow verification that the full message has indeed been received (e.g. should it span multiple packets).
- sendingTime - nanosecond-precision timestamp indicating when the message left the sender.
- msgSeqNum - this is the standard integer message sequence number. When first establishing a connection at the start of a trading week, it should be set to '1', and incremented with every subsequent message sent for the remainder of the trading week.
msgSeqNum
This field should never be reset intra-week, for any session type.
If the Client should disconnect from Whisperer during the trading week, they must continue the message sequence.
Users
Whisperer Direct requires the configuration of at least one 'User' to be used for a given Session. In general a single User should be associated with a single Venue/Session, although there is some flexibility as set out below.
| Venue Type | |||
|---|---|---|---|
| SessionType | CLOB | Maker | Taker |
| Pricing | The client may organise subscriptions across Users as it deems fit. Venues may reject multiple identical requests, so care should be taken to ensure that there is a clear demarcation of responsibility across Users. Only the last user to logout from a venue will cause Whisperer to logout from the Venue. It follows then that when multiple users are configured, when logging off prior users, it is the responsibility of the Whisperer client to ensure that the user session is cleaned up correctly prior to logout. | The client may organise subscriptions across Users as it deems fit. Venues may reject multiple identical requests, so care should be taken to ensure that there is a clear demarcation of responsibility across Users. Only the last user to logout from a venue will cause Whisperer to logout from the Venue. It follows then that when multiple users are configured, when logging off prior users, it is the responsibility of the Whisperer client to ensure that the user session is cleaned up correctly prior to logout. | A single User must be defined. This avoids the need for configuration and logic to be maintained within MarketFactory to route each Venue ESP QuoteRequest to specific individual Users. |
| Orders | The Whisperer client may distribute Orders across Users as it deems fit. | The Whisperer client may distribute Orders across Users as it deems fit. | A single User must be defined. This avoids the need for configuration and logic to be maintained within MarketFactory to route each Venue ESP Order to specific individual Users. |
| RFS | - | The Whisperer client may distribute RFQ and/or RFS across Users as it deems fit. | A single User must be defined. This avoids the need for configuration and logic to be maintained within MarketFactory to route each Venue RFS/RFQ QuoteRequest to specific individual Users. |
| DropCopy | This is a single feed per Venue, delivering trade notifications from the Venue to to the Customer. A single User is defined. This avoids the need for configuration and logic to be maintained within MarketFactory to route trade notifications from the Venue to specific individual users. | ||
Client Session Management
Logon
Session Synchronisation
The Whisperer SBE4 APi utilises the 'new' model of session synchronisation introduced in FIX 4.4. This ensures that each side can expect any sequence number gaps to be filled automatically, eliminating the need for ResendRequest messages - and the problems that historically accompany these.
The MFAPI client initiates a new session with a Logon message - this contains the next MsgSeqNum[34] value that the client expects to receive from the Whisperer Feed Handler.
The Whisperer Feed Handler validates the sequence number value as expected by the MFAPI client as follows:
- If the Client is expecting a sequence number higher than the FH's next-to-be-assigned msgSeqNum, then this is an unrecoverable error and the FH will abort the session with a Logout message.
- Otherwise the FH will issue a LogonResponse message containing the next MsgSeqNum[34] value that it expects to receive from the client.
- If the Client is expecting a sequence number lower than the FH's next-to-be-assigned msgSeqNum[34], then the message gap is resolved by the FH with SequenceResetGapFill messages and the resending of persisted messages as necessary.
The Whisperer Feed Handler signals it's completion of session synchronisation with a TestRequest.
Any new (i.e. not SequenceResetGapFill or resent) messages sent by the MFAPI Client prior to the required Heartbeat response will result in ErrorReport messages.
After any inbound sequence number gaps have been resolved for the MFAPI Client, it then reciprocates in a similar manner, based on the the next MsgSeqNum[34] value that the Whisperer Feed Handler expects to receive from the client - as specified in it's LogonResponse.
The mutual exchange of TestRequest and Heartbeat (response) messages are required as verification that no sequence number gaps remain.
The MFAPI client should only proceed with new messages after it has received the Heartbeat sent in response to it's own TestRequest.
Message Persistence
The table below specifies what messages are to be persisted and resent when necessary, as opposed to being gap-filled:
| Message | Sent By | Received By | Persisted |
|---|---|---|---|
| Logon | Client (Both) | Feed Handler | No |
| LogonResponse | Feed Handler | Client (Both) | No |
| Logout | Client (Both) | Feed Handler | No |
| LogoutResponse | Feed Handler | Client (Both) | No |
| SequenceResetGapFill | Client (Both) | Feed Handler | No |
| Feed Handler | Client (Both) | No | |
| Heartbeat | Client (Both) | Feed Handler | No |
| Feed Handler | Client (Both) | No | |
| TestRequest | Client (Both) | Feed Handler | No |
| Feed Handler | Client (Both) | No | |
| SecurityStatus | Feed Handler | Client (TAKER) | No |
| UserRequest | Client (Both) | Feed Handler | No |
| UserNotification | Feed Handler | Client (Both) | No |
| ErrorReport | Feed Handler | Client (Both) | Yes |
| MarketDataRequest | Client (Both) | Feed Handler | No |
| MarketDataRequestReject | Feed Handler | Client (Both) | No |
| MarketDataIncrementalRefresh | Feed Handler | Client (Both) | No |
| QuoteRequest | Client (TAKER) | Feed Handler | Optional |
| Feed Handler | Client (MAKER) | Yes | |
| QuoteRequestReject | Client (MAKER) | Feed Handler | Optional |
| Feed Handler | Client (TAKER) | Yes | |
| Quote | Client (MAKER) | Feed Handler | No |
| Feed Handler | Client (TAKER) | No | |
| MassQuote | Client (MAKER) | Feed Handler | No |
| Feed Handler | Client (TAKER) | No | |
| QuoteResponse | Client (MAKER) | Feed Handler | Optional |
| Feed Handler | Client (TAKER) | Yes | |
| Client (TAKER) | Feed Handler | Optional | |
| Feed Handler | Client (MAKER) | Yes | |
| NewOrderMultileg | Client (Both) | Feed Handler | Optional |
| Feed Handler | Client (MAKER) | Yes | |
| OrderCancelReplaceRequest | Client (Both) | Feed Handler | Optional |
| OrderCancelRequest | Client (Both) | Feed Handler | Optional |
| OrderCancelReject | Feed Handler | Client (Both) | Yes |
| OrderTimeout | Feed Handler | Client (Both) | Yes |
| ExecutionReport | Client (MAKER) | Feed Handler | Yes |
| Feed Handler | Client (TAKER) | Yes | |
| ExecutionAck | Client (TAKER) | Feed Handler | Optional |
| Feed Handler | Client (MAKER) | Yes |
Logon to Existing Session
Any attempt by the MFAPI client to log on to an existing session will result in the session being aborted.
Session Monitoring
Active sessions are monitored at the application level by each party via Heartbeat and TestRequest messages. Indications of problems must result in the monitoring party aborting the session.
The maximum allowed message transmission time (MaxTx) between between the MFAPI Client and the Whisperer Feed Handler is fixed, currently set to one second.
Heartbeats
Once the MFAPI Client has successfully established a session with the Whisperer Feed Handler (i.e. on dispatch of the first Heartbeat message in response to the end of synchronisation TestRequest), subsequent Heartbeat messages are sent by each party at the interval specified by the MFAPI client in it's Logon message.
Test Request
TestRequest messages may be issued by either party and under normal circumstances result in a Heartbeat being sent in response, echoing the specified TestRequestID.
TestRequest messages may be used to obtain an approximate indication of message round-trip times between the MFAPI Client and the Whisperer Feed Handler.
Logout
All Logout messages must be echoed with a LogoutResponse.
If no LogoutResponse is received within HeartBtInt + MaxTx seconds of the issuance of the Logout, then the session and associated TCP socket connection must be dropped.
All messages received by the Whisperer Feed Handler (from either the MFSBE4 client or the Venue) between the exchange of Logout and LogoutResponse messages will result in ErrorReport messages being sent to the client.
ErrorReport
The ErrorReport is a custom, user-defined, message used by the Whisperer Feed Handler to notify the MFSBE4 Client when erroneous messages are received:
From Client
- At an invalid lifecycle phase (e.g. QuoteRequest sent before the connection to the Maker Venue is established, or after the Whisperer Feed Handler has disconnected from the Venue).
- Message is not supported by the Venue (e.g. sending a Quote to a Maker Venue).
- Message contains invalid data.
From Venue
- A FIX Reject or BusinessMessageReject message
Since there are scenarios where ErrorReport messages may not be delivered (e.g. during session abort sequences), these messages are persisted and will be delivered on reconnection.
Venue Session Management
Whisperer is solely responsible for the management and correct handling of Venue-side Session Synchronisation, including the necessary logic relating to End of Day Resets etc.
Venue Logon
Session startup behaviour is standardised across Taker, Maker and CLOB Venue types as follows:
- The MFSBE4 Client first establishes connection to Whisperer with Logon & LogonResponse, then establishes connection to the Venue with UserRequest (UserRequestType=LogOnUser) & UserNotification (UserStatus=LoggedOn).
- Any MFSBE4 Client pricing/trading requests sent before this will be rejected by Whisperer via ErrorReport messages.
Venue Logoff
Venue logoff may be initiated as a result of any of the following:
- A request from the MFSBE4 client via UserRequest (UserRequestType=LogOffUser).
- The Venue initiates a Logout (e.g. End of Day).
- Whisperer detects a dropped connection
In all scenarios, the MFSBE4 Client is notified of the event via UserNotification (UserStatus=LoggedOff).
TODO
Illustrate multiple logon attempts to venue - 5 attempts, one minute interval, then logout to client. Eg Consider Reuters MAPI.
TODO
Illustrate EOD session/seq num resets.
TODO
Illustrate Multiplexing - multiple users connecting to Venue. First user triggers logon, last user triggers logout.
TODO
user sends initiates a transaction after after receiving a loggedout user notification