Subjects, symbols and fields

A message sent between Liberator and a client application, or between two DataSource applications is identified by its subject. When the message is about a financial instrument, the subject often contains a symbol  – a letter or sequence of letters used to identify the instrument. The symbols used can be a conventional set that apply to a particular area of the financial trading world. For example, FX (Foreign Exchange) instruments are uniquely identified by currency pair symbols such as EURUSD, where EUR means "Euros" and USD means "US Dollars" (see What format can symbols have?).

A typical format for a message is a record, consisting of a subject and a number of fields.

Here's an example of a simple record message:

Subject Fields
/FX/EURUSD price=1.334

In this example the record contains FX price information. The record's subject is /FX/EURUSD, which contains the symbol  EURUSD. The /FX part of the subject is a directory under which all the FX instruments are grouped. The record contains a single field called "price" that contains the currency's indicative exchange rate in US dollars per Euro.

Where did the price information in this example come from?

The prices would typically originate from a Foreign Exchange price feed. An Integration Adapter in the Caplin Platform converts the price information from the feed into DataSource messages, which in the simplest implementation are passed directly to a Liberator. The Liberator caches the records and pushes them out to subscribing clients via StreamLink.

What format can subjects have?

Subjects can have an arbitrary format, but they must start with a "/" as shown in the example above, and are usually organised in a "/" separated directory structure.

What format can symbols have?

The actual symbol structure and naming conventions used in a particular message depend on the type of system that the Caplin Platform forms a part of (for example a foreign exchange trading system, or a securities market data system), and the naming conventions used by the external systems connected to the Integration Adapters. The Integration Adapter is often implemented so it maps the symbols of records received from an external system into a format used internally to the Caplin Platform, and for presentation to clients.

More about fields

A field is a specific piece of information relating to the subject. For example, the fields for a record containing a foreign exchange quote might include “Bid” (the bid price), “Ask” (the asking price), and “Amount” (the maximum amount of the base currency that can be traded at the quoted price).

When the Liberator sends an update message to a client, it normally only includes in the message the fields that have changed.*  For example, when a client first subscribes to Liberator to obtain a quote for /FX/EURUSD, the record returned will contain all the relevant fields:

/FX/EURUSD Bid=1.3442 Ask=1.3448 Amount=10000

If the Ask price subsequently changes, the Liberator will send the client an update containing just the new value of the Ask field:

/FX/EURUSD Ask=1.3450

The range of fields available for a particular financial instrument depends on the source of the data and how you implement the Integration Adapter that forwards the data into the Caplin Platform.

* Alternatively Liberator can be configured to always send all the subscribed fields of a data item to the client whenever the item is updated.

 

See also: