Data Contribution is a means of sending your pricing data to the Real-Time Distribution System (RTDS), from where it can be fanned out globally. Leading market participants, such as banks and brokers, use RTDS to publish and distribute their information to the community of financial professionals.
The Contributed Data is sent directly from the client to the RTDS and not via a financial exchange.
From a programming perspective, the functionality used for Contributing data is known as Posting.
There are two forms of Posting supported by the ADS:
For an On-Stream Post we need to first send a Request message for the existing Item we want to Post to. The Request message would be the same as standard Data request message as discussed in the earlier. However, it is unlikely the service you are Posting to would be the default JSON service on the ADS (e.g. ELEKTRON_DD) – rather it would be the name of a cache service or Contribution service - setup by your internal Market Data team. Therefore, the Request message will almost certainly require a Service to be specified:
{
"ID":2,
"Key":{
"Name":"UMER.TST"
},
"Service":"NIPROV"
}
Here we are requesting the existing data item ‘UMER.TST’ from the ‘NIPROV’ service – note the stream ID of 2.
The exact service name and RIC naming will be determined by your internal Market Data team – who should be able to advise you.
If the requested RIC exists in the cache we should receive a Refresh Response:
{
"ID": 2,
"Type": "Refresh",
"Key": {
"Service": "NIPROV",
"Name": "UMER.TST"
},
"State": {
"Stream": "Open",
"Data": "Ok"
},
"Qos": {
"Timeliness": "Realtime",
"Rate": "TickByTick"
},
"PostUserInfo": {
"Address": "127.0.0.1",
"UserID": 5796
},
"Fields": {
"BID": 45.55,
"ASK": 45.57,
"BIDSIZE": 18,
"ASKSIZE": 19
}
}
Now that we have an open stream for the data item we can then use the stream ID of 2 to push our data to the cache:
{
"Ack": true,
"Domain": "MarketPrice",
"ID": 2,
"Message": {
"Domain": "MarketPrice",
"Fields": {
"ASK": 45.58,
"ASKSIZE": 20
},
"ID": 0,
"Type": "Update"
},
"PostID": 1,
"PostUserInfo": {
"Address": "127.0.0.1",
"UserID": 55555
},
"Type": "Post"
}
A few things to note:
Assuming the Post message content is valid, we should receive an ‘Ack’ message back from the ADS which should look something like:
{
"ID": 2,
"Type": "Ack",
"AckID": 1,
"Key": {
"Service": "NIPROV",
"Name": "UMER.TST"
}
Note the AckID of 1 which corresponds to the PostID of 1 we specified in the Post message we just sent to the server. We can use this value to identify which Post the Ack relates to. Therefore, we should use unique PostIds for each Post message we send.
On-Stream posting makes sense when we want to consume the existing data items we are posting to. If however, we are only interested in pushing values to the cache without consuming it – we can use Off-Stream posting.
For an Off-Stream Post we don’t need to have previously opened a stream for the item we want to post to - indeed the item may not even exist and we want to use the Post to create the item. We do need an open Login stream and therefore need to be successfully logged into the server.
Assuming you have already created your Websocket and performed a successful Login – we can send an Off-Stream Post using the Login Stream ID of 1.
{
"ID": 1,
"Type": "Post",
"Domain": "MarketPrice",
"Key": {
"Service": "NIPROV",
"Name": "FRED.TST"
},
"Ack": true,
"PostID": 1,
"PostUserInfo": {
"Address": "127.0.0.1",
"UserID": 5796
},
"Message": {
"ID": 0,
"Type": "Refresh",
"Solicited": false,
"State": {
"Stream": "Open",
"Data": "Ok"
},
"Fields": {
"BID": 45.55,
"BIDSIZE": 18,
"ASK": 45.57,
"ASKSIZE": 19
}
}
}
Notice the following:
In the examples above I have posted a Refresh and an Update – purely for demonstration purposes. However, your choice of which to use will depend on your requirements:
If we try to post an Update to a non-existent item we will get an ‘Ack’ response but with a NakCode e.g. if we try to post to a non-existent item ‘DAVE.TST’ we get:
{
"ID": 1,
"Type": "Ack",
"AckID": 1,
"NakCode": "SymbolUnknown",
"Text": "F44: Unable to find item on post update.",
"Key": {
"Service": "NIPROV",
"Name": "DAVE.TST"
}
}
There are other situations where you can get a NakCode e.g. permission issues, stream not open – a list of the NakCode attribute can be found in the WebSocket API Try it Now! Documentation - some of which I have listed below:
• AccessDenied: The user is not permissioned to post on the item or service.
• DeniedBySrc: The source being posted to has denied accepting this post message.
• GatewayDown: A gateway device for handling posted or contributed information is down or unavailable.
• InvalidContent: The content of the post message is invalid (it does not match the expected formatting) and cannot be posted.
• None: No Nak Code.
• NoResources: Some component along the path of the post message does not have appropriate resources available to continue processing the post.
• NoResponse: There is no response from the source being posted to. This may mean that the source is unavailable or that there is a delay in processing the posted information.
• NotOpen: The item being posted to does not have an available stream.
• SourceDown: The source being posted to is down or unavailable.
• SourceUnknown: The source being posted to is unknown and unreachable.
• SymbolUnknown: The system does not recognize the item information provided with the post message. This may be an invalid item.