Trade model: ESP

This page describes the FX Integration API’s ESP trade model, as defined in the file config/TradingAdapter/Blade/DataSource/etc/trademodels.xml in the FX Integration API Kit.

This documentation is for the FX Integration API 3.39.0.

Trade models are XML-defined state machines used by the Java Trading API, the C Trading API, and Caplin Trader’s Trading API to manage trading workflows. For more information on trade model XML definitions, see the Trade model XML schema reference.

State diagram

The state diagram for the ESP trade model is shown below. To simplify the diagram, the Rejected and Error states have been omitted.

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

Messages: client → server

Trade-channel messages sent by StreamLink clients to the FX API DataSource.

Submit
ESPSubmission
ESPSubmissionLeg Ln
Ln_Price
string
Ln_FwdPoints
decimal
Example: 0.001198
Ln_FwdPips
string
Example: 11.98
MsgType
String
Example: Submit
Name of the transition
RequestID
String
The RequestID. A Unique identifier, must remain the same for each event in the trade model
QuoteID
string
The unique ID of the quote the client wants to trade on.
SpotRate
decimal
Example: 1.08341
OneClickActionType
string
SlippageAmount
decimal
The amount that an order can slip before it needs to be filled
ClientClose
MsgType
String
Example: ClientClose
Name of the transition
RequestID
String
The RequestID. A Unique identifier, must remain the same for each event in the trade model

Messages: server → client

Messages sent by the FX API DataSource to StreamLink clients.

SubmitAck
MsgType
String
Example: SubmitAck
Name of the transition
RequestID
String
The RequestID. A Unique identifier, must remain the same for each event in the trade model
ClientCloseAck
MsgType
String
Example: ClientCloseAck
Name of the transition
RequestID
String
The RequestID. A Unique identifier, must remain the same for each event in the trade model
Hold
MsgType
String
Example: Hold
Name of the transition
RequestID
String
The RequestID. A Unique identifier, must remain the same for each event in the trade model
PickUp
MsgType
String
Example: PickUp
Name of the transition
RequestID
String
The RequestID. A Unique identifier, must remain the same for each event in the trade model
TradeConfirmation Spot Trade Confirmation
CommonTradeConfirmationFields
TradeID
string
Example: 00001561
A unique identifier for this trade
CurrencyPair
string
The currency pair for the trade. For example, EURUSD
DealtCurrency
string
The currency of the Amount of a trade or order.
SpotRate
decimal
Example: 1.08341
SpotMidRate
decimal
Example: 1.08345
The mid rate between the SpotAskRate and SpotBidRate. Note that this will not always be precisely between.
SpotRateDPS
integer
Example: 5
The number of decimal places to display after the decimal point.
ExecutionDateTime
string
Example: 20160322123621
TradeDate
string
Example: 20160314
Account
string
Example: Garfields|GARF
The account a trade or order has been submitted against. The format is <description>|<name> or <name>|<name>
TraderUsername
string
Example: sales_trader@novobank.co.za
The user who entered the trade. This may be on behalf of themselves, or on behalf of someone else. For example, if the logged in user dealer1@novobank.co.za wishes to make a trade on behalf of user client@customer.co.za, then the value of this field will be dealer1@novobank.co.za. If the user client@customer.co.za makes a trade on behalf of themselves it will be client@customer.co.za.
TOBOUser
string
Example: client@customer.co.za
The user the trade is on behalf of. For example, if the logged in user dealer1@novobank.co.za wishes to make a trade on behalf of user client@customer.co.za, then the value of this field will be client@customer.co.za.
EntityId
string
Example: CUSTONE
The entity the trade is on behalf of. For example, if the logged in user user1@customer.co.za wishes to make a trade on behalf of entity CUSTONE, then the value of this field will be CUSTONE.
EntityDescription
string
Example: Customer 1
The description of a trade on behalf of entity.
AssetType
string
TradingType
string
Caplin supported values are [SPOT, FWD, NDF, SWAP, TIME_OPTION]. See the constants defined within com.caplin.motif.fx.trading.FXTradingType for further details.
DigitsBeforePips
integer
Example: 2
Precision-related field that tells the client how to display rates. This is the number of digits between the decimal point and the pips (i.e the big digits that the client wants to look at). For most currency pairs the value of this bla will be 2, i.e. for a USDGBP rate of 1.23456 the pips are 45 so there are two digits between the decimal point and the pips. For USDJPY the rate could be 103.256 and the pips are the 25, so in this case the value of DigitsBeforePips should be 0.
NumberOfPips
integer
Example: 2
Precision-related field that tells the client how to display rates. This is the number of pips the client wants to look at. Normally this value is 2.
OrderID
string
The id of the order.
WarningCode
string
Example: 001
The code for the warning regarding a quote request.
WarningMessage
string
Example: You do not have sufficient credit for EUR
The message to display for any warnings regarding a quote request
Client
string
Client is a duplicate of TOBOUser
CostAmount
decimal
Example: 12412891.31
The total transactional cost of performing the trade to the client
CostCurrency
string
Example: GBP
The currency that the cost is displayed in, this could be any currency but will typically be set to the Term Currency
CostPercentage
decimal
Example: 13.56
Percentage of the overall price which is the transactional cost to the client of performing the trade. This number should be out of 100, where 100.0 represents 100%.
IsReversible
boolean
Whether a trade can be reversed.
IsAmendable
boolean
Whether a trade can be amended.
IsCancellable
boolean
Whether a trade can be cancelled.
CostCurrencyDPS
integer
Example: 2
The number of decimal places to display after the decimal point.
Remarks
string
The clients or trader's comments on an order leg - visible to both the Client and the Trader
LegTradeConfirmationFields L1
SettlementTradeFields L1
SettlementFields L1
L1_SettlementId
string
The identifier for the trade.
L1_SettlementCurrency
string
Example: GBP
A currency for of settlement instruction
L1_SettlementAmount
decimal
The amount of a settlement
L1_SettlementDirection
string
The direction in which the settlement details refer to, supported directions are: PAY, RECEIVE, BOTH
L1_IsDefaultSettlementInstruction
boolean
Is this the default settlement instruction for this currency
L1_SettlementInstructionType
string
Example: EXISTING
The type of settlement instruction attached to a trade. Supported types are [EXISTING, ADHOC, NONE]
L1_SettlementDisplayName
string
Example: [CCY] Account 1
The name of the settlement instruction. This field can be omitted.
L1_SettlementStatus
string
Caplin supported statuses are [PENDING, AFFIRMED, CONFIRMED, OVERDUE, REJECTED]
L1_BankAccount
string
Example: 12345678
The account number of the bank
L1_BankSwift
string
Example: CAP123
The BIC of the bank
L1_BankName
string
Example: Bank Of Caplin
The name of the bank
L1_BankAddress1
string
Example: 12 Capitol
The first line of the bank's address
L1_BankAddress2
string
Example: The City
The second line of the bank's address
L1_BankAddress3
string
Example: London
The third line of the bank's address
L1_IndividualAccount
string
Example: 87654321
The account number of the recipient
L1_IndividualSwift
string
Example: SOLD987
The BIC of the recipient's account
L1_IndividualName
string
Example: Susan Sellers
The name of the payee or payee's bank
L1_IndividualAddress1
string
Example: 98 Lane
The first line of the recipient
L1_IndividualAddress2
string
Example: Manchester
The second line of the recipient
L1_NettingStatus
string
Example: NETTED
The status that denotes the permanent netting state of a settlement. This is required to know which settlements have been netted and which have not
L1_SplitComponentId
string
The unique ID of a split component
L1_SettlementDetailsLine1
string
The first line of remittance information.
L1_SettlementDetailsLine2
string
The second line of remittance information.
L1_SettlementDetailsLine3
string
The third line of remittance information.
L1_SettlementDetailsLine4
string
The fourth line of remittance information.
SettlementFields L1
L1_SettlementId
string
The identifier for the trade.
L1_SettlementCurrency
string
Example: GBP
A currency for of settlement instruction
L1_SettlementAmount
decimal
The amount of a settlement
L1_SettlementDirection
string
The direction in which the settlement details refer to, supported directions are: PAY, RECEIVE, BOTH
L1_IsDefaultSettlementInstruction
boolean
Is this the default settlement instruction for this currency
L1_SettlementInstructionType
string
Example: EXISTING
The type of settlement instruction attached to a trade. Supported types are [EXISTING, ADHOC, NONE]
L1_SettlementDisplayName
string
Example: [CCY] Account 1
The name of the settlement instruction. This field can be omitted.
L1_SettlementStatus
string
Caplin supported statuses are [PENDING, AFFIRMED, CONFIRMED, OVERDUE, REJECTED]
L1_BankAccount
string
Example: 12345678
The account number of the bank
L1_BankSwift
string
Example: CAP123
The BIC of the bank
L1_BankName
string
Example: Bank Of Caplin
The name of the bank
L1_BankAddress1
string
Example: 12 Capitol
The first line of the bank's address
L1_BankAddress2
string
Example: The City
The second line of the bank's address
L1_BankAddress3
string
Example: London
The third line of the bank's address
L1_IndividualAccount
string
Example: 87654321
The account number of the recipient
L1_IndividualSwift
string
Example: SOLD987
The BIC of the recipient's account
L1_IndividualName
string
Example: Susan Sellers
The name of the payee or payee's bank
L1_IndividualAddress1
string
Example: 98 Lane
The first line of the recipient
L1_IndividualAddress2
string
Example: Manchester
The second line of the recipient
L1_NettingStatus
string
Example: NETTED
The status that denotes the permanent netting state of a settlement. This is required to know which settlements have been netted and which have not
L1_SplitComponentId
string
The unique ID of a split component
L1_SettlementDetailsLine1
string
The first line of remittance information.
L1_SettlementDetailsLine2
string
The second line of remittance information.
L1_SettlementDetailsLine3
string
The third line of remittance information.
L1_SettlementDetailsLine4
string
The fourth line of remittance information.
L1_CanAffirm
boolean
Can affirm settlement instructions for a trade.
L1_CanConfirm
boolean
Can confirm settlement instructions for a trade.
L1_CanAdHoc
boolean
Can confirm adhoc settlement instructions for a trade.
L1_SettlementStatus
string
Caplin supported statuses are [PENDING, AFFIRMED, CONFIRMED, OVERDUE, REJECTED]
L1_NextActionDeadline
datetime
Example: 2018-03-16T07:25:16+00:00
The deadline for a user to perform a trade's next action in ISO-8601 format
L1_NextActionDeadlineDisplayTimezone
string
Example: America/New_York
The timezone for the NextActionDeadline field in the form Area/Location
L1_AffirmedBy
string
The name of the user who affirmed a trade.
L1_AffirmedDateTime
datetime
Example: 2018-03-16T07:25:16+00:00
The time at which a trade was affirmed in ISO-8601 format
L1_ConfirmedBy
string
The name of the user who confirmed a trade.
L1_ConfirmedDateTime
datetime
Example: 2018-03-16T07:25:16+00:00
The time at which a trade was confirmed in ISO-8601 format
L1_AllInRate
decimal
Example: 1.091790
L1_AllInRateDPS
integer
Example: 5
L1_AllInMidRate
decimal
Example: 1.091790
L1_FwdPoints
decimal
Example: 0.001198
L1_FwdMidPoints
decimal
Example: 0.005390
L1_FwdPips
string
Example: 11.98
L1_BuySell
string
The direction of the trade or trade leg. This always refers to the BaseCurrency, NOT the DealtCurrency.
L1_Amount
decimal
The amount of a trade or order in the DealtCurrency.
L1_ContraAmount
decimal
Example: 350
The amount that is exchanged for the Amount. This will be defined in the contra currency of the DealtCurrency.
L1_Tenor
string
Example: 1M
Supported types are [ON, [TODAY, TOD, TD], TN, [TOM, ND], SPOT, SN, 1D, 1W, 2W, 3W, 4W, 1M, 2M, 4M, 5M, 6M, 7M, 8M, 9M, 10M, 11M, [1Y, 12M], 15M, 18M, 21M, [2Y, 24M], [3Y, 36M], [4Y, 48M], [5Y, 60M], broken]. broken indicates that a SettlementDate must be sent
L1_SettlementDate
string
L1_Account
string
Example: Garfields|GARF
The account a trade or order has been submitted against. The format is <description>|<name> or <name>|<name>
L1_Profit
decimal
Example: 1000
The sales profit in the specified currency.
L1_CostAmount
decimal
Example: 12412891.31
The total transactional cost of performing the trade to the client
TradeConfirmation Forward Trade Confirmation
CommonTradeConfirmationFields
TradeID
string
Example: 00001561
A unique identifier for this trade
CurrencyPair
string
The currency pair for the trade. For example, EURUSD
DealtCurrency
string
The currency of the Amount of a trade or order.
SpotRate
decimal
Example: 1.08341
SpotMidRate
decimal
Example: 1.08345
The mid rate between the SpotAskRate and SpotBidRate. Note that this will not always be precisely between.
SpotRateDPS
integer
Example: 5
The number of decimal places to display after the decimal point.
ExecutionDateTime
string
Example: 20160322123621
TradeDate
string
Example: 20160314
Account
string
Example: Garfields|GARF
The account a trade or order has been submitted against. The format is <description>|<name> or <name>|<name>
TraderUsername
string
Example: sales_trader@novobank.co.za
The user who entered the trade. This may be on behalf of themselves, or on behalf of someone else. For example, if the logged in user dealer1@novobank.co.za wishes to make a trade on behalf of user client@customer.co.za, then the value of this field will be dealer1@novobank.co.za. If the user client@customer.co.za makes a trade on behalf of themselves it will be client@customer.co.za.
TOBOUser
string
Example: client@customer.co.za
The user the trade is on behalf of. For example, if the logged in user dealer1@novobank.co.za wishes to make a trade on behalf of user client@customer.co.za, then the value of this field will be client@customer.co.za.
EntityId
string
Example: CUSTONE
The entity the trade is on behalf of. For example, if the logged in user user1@customer.co.za wishes to make a trade on behalf of entity CUSTONE, then the value of this field will be CUSTONE.
EntityDescription
string
Example: Customer 1
The description of a trade on behalf of entity.
AssetType
string
TradingType
string
Caplin supported values are [SPOT, FWD, NDF, SWAP, TIME_OPTION]. See the constants defined within com.caplin.motif.fx.trading.FXTradingType for further details.
DigitsBeforePips
integer
Example: 2
Precision-related field that tells the client how to display rates. This is the number of digits between the decimal point and the pips (i.e the big digits that the client wants to look at). For most currency pairs the value of this bla will be 2, i.e. for a USDGBP rate of 1.23456 the pips are 45 so there are two digits between the decimal point and the pips. For USDJPY the rate could be 103.256 and the pips are the 25, so in this case the value of DigitsBeforePips should be 0.
NumberOfPips
integer
Example: 2
Precision-related field that tells the client how to display rates. This is the number of pips the client wants to look at. Normally this value is 2.
OrderID
string
The id of the order.
WarningCode
string
Example: 001
The code for the warning regarding a quote request.
WarningMessage
string
Example: You do not have sufficient credit for EUR
The message to display for any warnings regarding a quote request
Client
string
Client is a duplicate of TOBOUser
CostAmount
decimal
Example: 12412891.31
The total transactional cost of performing the trade to the client
CostCurrency
string
Example: GBP
The currency that the cost is displayed in, this could be any currency but will typically be set to the Term Currency
CostPercentage
decimal
Example: 13.56
Percentage of the overall price which is the transactional cost to the client of performing the trade. This number should be out of 100, where 100.0 represents 100%.
IsReversible
boolean
Whether a trade can be reversed.
IsAmendable
boolean
Whether a trade can be amended.
IsCancellable
boolean
Whether a trade can be cancelled.
CostCurrencyDPS
integer
Example: 2
The number of decimal places to display after the decimal point.
Remarks
string
The clients or trader's comments on an order leg - visible to both the Client and the Trader
LegTradeConfirmationFields L1
SettlementTradeFields L1
SettlementFields L1
L1_SettlementId
string
The identifier for the trade.
L1_SettlementCurrency
string
Example: GBP
A currency for of settlement instruction
L1_SettlementAmount
decimal
The amount of a settlement
L1_SettlementDirection
string
The direction in which the settlement details refer to, supported directions are: PAY, RECEIVE, BOTH
L1_IsDefaultSettlementInstruction
boolean
Is this the default settlement instruction for this currency
L1_SettlementInstructionType
string
Example: EXISTING
The type of settlement instruction attached to a trade. Supported types are [EXISTING, ADHOC, NONE]
L1_SettlementDisplayName
string
Example: [CCY] Account 1
The name of the settlement instruction. This field can be omitted.
L1_SettlementStatus
string
Caplin supported statuses are [PENDING, AFFIRMED, CONFIRMED, OVERDUE, REJECTED]
L1_BankAccount
string
Example: 12345678
The account number of the bank
L1_BankSwift
string
Example: CAP123
The BIC of the bank
L1_BankName
string
Example: Bank Of Caplin
The name of the bank
L1_BankAddress1
string
Example: 12 Capitol
The first line of the bank's address
L1_BankAddress2
string
Example: The City
The second line of the bank's address
L1_BankAddress3
string
Example: London
The third line of the bank's address
L1_IndividualAccount
string
Example: 87654321
The account number of the recipient
L1_IndividualSwift
string
Example: SOLD987
The BIC of the recipient's account
L1_IndividualName
string
Example: Susan Sellers
The name of the payee or payee's bank
L1_IndividualAddress1
string
Example: 98 Lane
The first line of the recipient
L1_IndividualAddress2
string
Example: Manchester
The second line of the recipient
L1_NettingStatus
string
Example: NETTED
The status that denotes the permanent netting state of a settlement. This is required to know which settlements have been netted and which have not
L1_SplitComponentId
string
The unique ID of a split component
L1_SettlementDetailsLine1
string
The first line of remittance information.
L1_SettlementDetailsLine2
string
The second line of remittance information.
L1_SettlementDetailsLine3
string
The third line of remittance information.
L1_SettlementDetailsLine4
string
The fourth line of remittance information.
SettlementFields L1
L1_SettlementId
string
The identifier for the trade.
L1_SettlementCurrency
string
Example: GBP
A currency for of settlement instruction
L1_SettlementAmount
decimal
The amount of a settlement
L1_SettlementDirection
string
The direction in which the settlement details refer to, supported directions are: PAY, RECEIVE, BOTH
L1_IsDefaultSettlementInstruction
boolean
Is this the default settlement instruction for this currency
L1_SettlementInstructionType
string
Example: EXISTING
The type of settlement instruction attached to a trade. Supported types are [EXISTING, ADHOC, NONE]
L1_SettlementDisplayName
string
Example: [CCY] Account 1
The name of the settlement instruction. This field can be omitted.
L1_SettlementStatus
string
Caplin supported statuses are [PENDING, AFFIRMED, CONFIRMED, OVERDUE, REJECTED]
L1_BankAccount
string
Example: 12345678
The account number of the bank
L1_BankSwift
string
Example: CAP123
The BIC of the bank
L1_BankName
string
Example: Bank Of Caplin
The name of the bank
L1_BankAddress1
string
Example: 12 Capitol
The first line of the bank's address
L1_BankAddress2
string
Example: The City
The second line of the bank's address
L1_BankAddress3
string
Example: London
The third line of the bank's address
L1_IndividualAccount
string
Example: 87654321
The account number of the recipient
L1_IndividualSwift
string
Example: SOLD987
The BIC of the recipient's account
L1_IndividualName
string
Example: Susan Sellers
The name of the payee or payee's bank
L1_IndividualAddress1
string
Example: 98 Lane
The first line of the recipient
L1_IndividualAddress2
string
Example: Manchester
The second line of the recipient
L1_NettingStatus
string
Example: NETTED
The status that denotes the permanent netting state of a settlement. This is required to know which settlements have been netted and which have not
L1_SplitComponentId
string
The unique ID of a split component
L1_SettlementDetailsLine1
string
The first line of remittance information.
L1_SettlementDetailsLine2
string
The second line of remittance information.
L1_SettlementDetailsLine3
string
The third line of remittance information.
L1_SettlementDetailsLine4
string
The fourth line of remittance information.
L1_CanAffirm
boolean
Can affirm settlement instructions for a trade.
L1_CanConfirm
boolean
Can confirm settlement instructions for a trade.
L1_CanAdHoc
boolean
Can confirm adhoc settlement instructions for a trade.
L1_SettlementStatus
string
Caplin supported statuses are [PENDING, AFFIRMED, CONFIRMED, OVERDUE, REJECTED]
L1_NextActionDeadline
datetime
Example: 2018-03-16T07:25:16+00:00
The deadline for a user to perform a trade's next action in ISO-8601 format
L1_NextActionDeadlineDisplayTimezone
string
Example: America/New_York
The timezone for the NextActionDeadline field in the form Area/Location
L1_AffirmedBy
string
The name of the user who affirmed a trade.
L1_AffirmedDateTime
datetime
Example: 2018-03-16T07:25:16+00:00
The time at which a trade was affirmed in ISO-8601 format
L1_ConfirmedBy
string
The name of the user who confirmed a trade.
L1_ConfirmedDateTime
datetime
Example: 2018-03-16T07:25:16+00:00
The time at which a trade was confirmed in ISO-8601 format
L1_AllInRate
decimal
Example: 1.091790
L1_AllInRateDPS
integer
Example: 5
L1_AllInMidRate
decimal
Example: 1.091790
L1_FwdPoints
decimal
Example: 0.001198
L1_FwdMidPoints
decimal
Example: 0.005390
L1_FwdPips
string
Example: 11.98
L1_BuySell
string
The direction of the trade or trade leg. This always refers to the BaseCurrency, NOT the DealtCurrency.
L1_Amount
decimal
The amount of a trade or order in the DealtCurrency.
L1_ContraAmount
decimal
Example: 350
The amount that is exchanged for the Amount. This will be defined in the contra currency of the DealtCurrency.
L1_Tenor
string
Example: 1M
Supported types are [ON, [TODAY, TOD, TD], TN, [TOM, ND], SPOT, SN, 1D, 1W, 2W, 3W, 4W, 1M, 2M, 4M, 5M, 6M, 7M, 8M, 9M, 10M, 11M, [1Y, 12M], 15M, 18M, 21M, [2Y, 24M], [3Y, 36M], [4Y, 48M], [5Y, 60M], broken]. broken indicates that a SettlementDate must be sent
L1_SettlementDate
string
L1_Account
string
Example: Garfields|GARF
The account a trade or order has been submitted against. The format is <description>|<name> or <name>|<name>
L1_Profit
decimal
Example: 1000
The sales profit in the specified currency.
L1_CostAmount
decimal
Example: 12412891.31
The total transactional cost of performing the trade to the client
NDFLegTradeConfirmationFields L1
L1_FixingDate
string
Example: 20150620
L1_FixingCurrency
string
Example: USD
L1_FixingCode
string
Example: [CCY]1/1600/GBLO
L1_FixingDescription
string
Example: WMR [CCY] 4pm London
TimeOptionLegTradeConfirmationFields L1
L1_FilledAmount
decimal
Example: 0
L1_RemainingAmount
decimal
Example: 500
L1_RiskDate
string
Example: 20160314
L1_RiskTenor
string
Example: 1W
L1_StartDate
string
Example: 20150620
L1_StartTenor
string
Example: 1W