Implementing Sales Intervention

This page provides a guide to the changes you need to make to your integration adapters to implement FX Sale’s Sales Intervention functionality.

Requirements

Sales Intervention has the following requirements:

  • FX Sales 1.18 or greater

  • FX Integration API v3.5 or greater

  • A User Details Adapter. For more information, see User Details Service in the FX Integration API.

Overview

Sales Intervention includes a new trade model that works in parallel to the RFS trade model for a trade. Some transitions in the two models are related. For example, when a sales trader picks up a trade for intervention, the Sales Intervention Model transitions to 'PickUpSent' and the RFS Trade Model transitions to 'PickedUp'.

The relationship between the two trade models is not handled automatically by the FX Integration API. It must be coded at the implementation level.

Integrating Sales Intervention into your trading workflow requires you to perform the following tasks:

  • Implement the FX Integration API listener interfaces for the Sales Intervention trade model. Where the Sales Intervention specification requires it, raise a transition event on the associated trade’s RFS trade model.

  • Edit your implementations of the FX Integration API listener interfaces for the RFS trade model. Where the Sales Intervention specification requires it, raise an event on the associated trade’s Sales Intervention trade model.

You will find the process of integration easier if you can implement listeners for the Sales Intervention trade model in the same integration adapter in which you implement listeners for the RFS trade model.

For an example of a trading adapter with a Sales Intervention implementation, see the Novo Trading Adapter example in the FX Integration API kit (v3.5 or greater).

Trade-model state diagrams

This section contains state diagrams for the following trade models:

RFS trade model

The state model for the RFS trade model is illustrated below. For more information on this trade model, see RFS Trade Messages.

State changes that are initiated by the FX Professional or FX Mobile client are in blue, and state changes that are initiated by the server are in green.

InitialSubmittedQueuedPickedUpExecutableExecuteSentExecutedWarningSentTradeConfirmedAcceptWarningSentClientCloseSentClientClosedExpiredSubmitSubmitAckPickUpHoldPriceUpdateWithdrawPriceUpdateExecuteExecuteAckPriceUpdateWarningTradeConfirmationAcceptWarningRejectWarningClientCloseAcceptWarningAckClientCloseClientCloseClientCloseClientCloseClientCloseAckExpireExpireExpireLegendTransitions initiated by the client are inyellow.Transitions initiated by the server are inblue.

Sales Intervention trade model

This documentation applies to the trade model in the FX Integration API 2. For documentation on trade models in the FX Integration API 3, see FX Integration API.

The Sales Intervention model is illustrated below.

State changes that are initiated by the FX Sales client are in blue, and state changes that are initiated by the server are in green.

InitialPickUpSentPickUpPendingClientRejectedPickedUpHoldSentRejectSentQuoteSentWithdrawSentQuotedTraderRejectedTradeConfirmationHeldPickUpPickUpAckPickUpRejectedPriceUpdateHoldRejectClientRejectQuotePriceUpdateHoldRejectClientRejectPriceUpdateClientRejectRejectWithdrawQuoteAckQuoteRejectAckWithdrawAckPriceUpdateRejectTradeConfirmedPriceUpdateWithdrawClientRejectRejectHoldAckLegendTransitions initiated by the client (the sales trader) are inyellow.Transitions initiated by the server are inblue.

Implementation

A typical intervention handler needs to perform the following tasks:

Handle the failure of a quote to pass risk assessment

In the onSubmit handler in your RFSTradeListener implementation, if the quote request submitted by the client fails risk assessment, then perform the following actions:

  1. Leave the quote in the Queued state (do not raise a Reject event on the RFS trade model).

  2. Store the quote request in a Sales Intervention queue.

  3. Add the quote request to the container subscribed to by the Active Deals Blotter in FX Sales: /PRIVATE/FX/SALES/BLOTTER/ACTIVEDEALS

    Records in the Active Deals Blotter container must have the following fields:

    • TradeRequestId: used to identify a quote that requires sales intervention

    • Dealable: determines whether a quote has yet to be picked up by a sales trader. When a quote is picked up by a sales trader, the Dealable field is set to false, and cannot be picked up by other sales traders.

Handle the pickup of a quote by a sales trader

In the onPickup handler in your SalesInterventionTradeListener implementation, perform the following tasks.

If the quote request is dealable (can be picked up):

  1. Raise a PickUp event on the RFS trade model.

  2. Raise a PickUpAckEvent on the Sales Intervention trade model.

  3. Raise a PriceUpdateEvent on the Sales Intervention trade model.

If the quote request is not dealable (cannot be picked up):

  1. Raise a PickupRejectedEvent on the Sales Intervention trade model.

Handle the sending of a price by a sales trader

In the onQuote handler in your SalesInterventionTradeListener implementation, perform the following tasks:

  1. Raise a QuoteAck event on the Sales Intervention trade model.

  2. Raise a PriceUpdate event on the RFS trade model.

When your integration code receives a price update from the backend, raise a PriceUpdate event on both the RFS trade model and the Sales Intervention trade model.

Handle the withdrawal of a price by a sales trader

In the onWithdraw handler in your SalesInterventionTradeListener implementation, perform the following tasks:

  1. Raise a Withdraw event on the RFS trade model.

  2. Raise a WithdrawAck event on the Sales Intervention trade model.

Handle the rejection of a quote request by a sales trader

In the onReject handler in your SalesInterventionTradeListener implementation, perform the following tasks:

  1. Raise a Reject event on the RFS trade model.

  2. Raise a RejectAck event on the Sales Intervention trade model.

  3. Schedule the removal of the quote’s record from the Active Deals Blotter.

Handle the release of a quote by a sales trader

In the onHold handler in your SalesInterventionTradeListener implementation, perform the following tasks:

  1. Raise a Hold event on the RFS trade model.

  2. Raise a HoldAck event on the Sales Intervention trade model.

Handle timeout of a quote

In the onTradeClose handler in your RFSTradeListener implementation, perform the following tasks:

  1. Raise a ClientReject event on the Sales Intervention trade model.

Handle rejection of a price by a client

In the onClientClose handlers in your RFSTradeListener implementation, perform the following tasks:

  1. Raise a ClientReject event on the Sales Intervention trade model.

Handle acceptance of a price by a client

In the onExecute handler in your RFSTradeListener impementation, perform the following tasks:

  1. Raise an ExecuteAck event on the RFS trade model

  2. Execute the trade on the backend trading system.

    1. If the trade executes successfully, then raise a TradeConfirmed event on both the RFS trade model and the Sales Intervention trade model.

    2. If the trade does not execute successfully, then raise a Reject event on both the RFS trade model and the Sales Intervention trade model.

Permissions

To grant a sales trader permission to use Sales Intervention, grant them permission for the FX-SALES-INTERVENTION action in the FX_SALES_INTERVENTION namespace.


See also: