LSEG Data Library for .NET

Delivery.RDPStreamDefinition object

Creates a definition used to get a RDPStream that can subscribe to streaming items of any Domain Model of the Delivery Platform (formerly Refinitiv Data Platform).

Syntax

Delivery.RDPStream.Definition()

RDP Stream Definition methods

Api(RDPStream.Api api)

Api(string api)

The streaming API service supporting the RDP streaming data.

The api paremeter is Optional. Configuration default: QuantativeAnalytics

Universe(params JObject[] universe)

Universe(IEnumerable universe)

Universe(params string[] universe)

Universe(IEnumerable universe)

Universe(JArray universe)

The Universe of item of interest as supported by the underlying RDP streaming service.

Fields(params string[] fields)

Fields(IEnumerable fields)

Fields(JArray fields)

Specify the specific fields delivered when messages arrive.

Parameters(JObject parameters)

Apply the service-specific parameters for each Universe defined.

Service(string service)

Offers the ability to use a specific service to manage the real-time streaming data.

Optional. Default: defined within the streaming platform.

ExtendedParams(JObject obj)

The streaming platform can offer a multitude of properties, depending on environment configuration.
In most cases, the default streaming environment is suitable for delivery. However, there may be some
rare cases where applications may need to define properties that are less commonly used. The extended
params specification provides this capability. To extend, applications must form the request properties
as defined within the WebSocket Request specifications. If extended properties are included, they will
be merged with all other properties specified.

The possible values for the RDPStream.Api:

Value Description
QuantitativeAnalytics Stream IPAs Financial Contracts.
Benchmark Stream Benchmark data services.

Returned value

RDPStreamDefinition object.

Usage

The following example demonstrates how to create an RDP stream definition:

var universe = new JObject()
{
    ["instrumentType"] = "FxCross",
    ["instrumentDefinition"] = new JObject()
    {
        ["fxCrossType"] = "FxSpot",
        ["fxCrossCode"] = "USDAUD"
    }
};

var parameters = new JObject()
{
    ["marketData"] = new JObject()
    {
        ["fxSpots"] = new JArray() 
        { 
            new JObject()
            {
                ["spotDefinition"] = new JObject()
                {
                    ["fxCrossCode"] = "AUDUSD",
                    ["Source"] = "Composite"
                }
            } 
        }
    }
};

// Note: The RDP stream interface defines a standard set of client => server request properties.  
// Because the implementation of the IPA streaming service breaks the standard and defines additional properties, 
// we are forced to utilize the ExtendedParamscapability below.  

var stream = RDPStream.Definition()
                      .Universe(universe)
                      .ExtendedParams(parameters)
                      .Fields("FxSpot_BidMidAsk", "Ccy1SpotDate", "Ccy2SpotDate", "ErrorCode")
                      .GetStream()
                      .OnResponse((msg, s) => Console.WriteLine($"Response: {msg}"))
                      .OnUpdate((msg, s) => Console.WriteLine($"Update: {DateTime.Now:HH:mm:ss} - {msg}"))
                      .OnAlarm((msg, s) => Console.WriteLine($"Stream alarm: {DateTime.Now:HH:mm:ss}: {msg}"));

The following example shows how to retrieve benchmark data using the RDP Stream Definition:

// The following request will perform a snapshot, despite requesting for streaming. 
var parameters = new JObject()
{
    ["calculationTypes"] = new JArray("vwap", "volume"),
    ["timeField"] = "ingest",
    ["startTime"] = new JObject()
    {
        ["absoluteTime"] = DateTime.Now.AddDays(-1).ToUniversalTime()
    },
    ["responseType"] = new JObject()
    {
        ["type"] = "streaming",
        ["conflation"] = "1m"
    },
    ["filters"] = new JArray(new JObject()
    {
        ["type"] = "tradeclassification",
        ["codes"] = new JArray("OB", "AU")
    }, new JObject()
    {
        ["type"] = "volume",
        ["min"] = 0,
        ["max"] = 100
    })
};

var stream = RDPStream.Definition()
                      .Api(RDPStream.Api.Benchmark)
                      .Universe("VOD.L", "AAPL.O")
                      .Parameters(parameters)
                      .GetStream()
                      .OnResponse((msg, s) => Console.WriteLine($"Response: {msg}"))
                      .OnUpdate((msg, s) => Console.WriteLine($"Update: {DateTime.Now:HH:mm:ss} - {msg}"))
                      .OnAlarm((msg, s) => Console.WriteLine($"Stream alarm: {DateTime.Now:HH:mm:ss}: {msg}"));