Timestamp resolution

From version 7.1 of the Caplin Platform, DataSource timestamps are recorded to a resolution of one microsecond or finer.

This change aligns the Caplin Platform with the financial industry's use of high-resolution timestamps to satisfy regulatory requirements for best execution, such as the revision to the Markets in Financial Instruments Directive due to come into effect on 3 January 2018 (MiFID II).

For more information on MiFID II's requirements for the accuracy and resolution of business clocks, see ESMA's RTS 25 and RTS 25: Annex 1.

Contents:

Requirements

Caplin Platform supports high-resolution timestamps from version 7.1.

High-resolution timestamps are supported by the following operating systems:

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Windows 7
  • Windows 10
  • Apple macOS 10.12 (Sierra) and higher
Note: Caplin Platform is supported on Microsoft Windows and Apple macOS for development use only. Caplin Platform components are tested on the latest version of macOS available at the time of testing (see the release notes for the specific version).

To measure latency with high-resolution timestamps, all components in the latency chain must be 7.1 or higher. Measuring latency across different versions of Caplin Platform components is not supported.

Breaking changes in Caplin Platform 7.1

The following breaking changes relating to timestamps were introduced with Caplin Platform 7.1.

New method and function signatures

The following DataSource for Java methods now take a java.time.Instant object as a parameter instead of a long:

  • RecordMessage.setInitialLatencyChainTime(java.time.Instant instant)
  • RecordMessage.addLatencyChainPoint(String pointName, java.time.Instant instant)

The following DataSource for C (DSDK) functions now take a timespec struct instead of an int64_t:

New binary format for packet logs

The binary format of packet logs has changed in Caplin Platform 7.1 to accommodate microsecond timestamps. Caplin Platform 7.1 packet logs can only be read by logcat 7.1 and later.

New timestamp format in event logs and logcat output

Timestamps for entries in event logs and in logcat output now have microsecond granularity. The fractional seconds component of each timestamp now extends to six figures rather than three, and this may break log scrapers that expect timestamps to have a fractional component fixed at three figures.

Log entry timestamp formats
DataSource Version Example
< 7.1 2015/09/22-14:10:57.112 +0100
>= 7.1 2015/09/22-14:10:57.112539 +0100

Timestamp accuracy in Caplin Platform 7.1

The accuracy of timestamps recorded by Caplin Platform can only be as accurate as the timestamps supplied to Caplin Platform by the operating system.

To accurately measure latency in the Caplin Platform, all Caplin Platform servers must be synchronised with the same time source.

For Caplin Platform timestamps to be comparable with backend timestamps, Caplin Platform servers must be synchronised with the same time source as backend servers. Backend servers that are compliant with MiFID II requirements for business clock accuracy will be synchronised with a time source that is directly traceable to Coordinated Universal Time (UTC). For an introduction to high-resolution clock synchronisation in the context of MiFID II, see Time Traceability for the Financial Sector, by the UK's National Physical Laboratory.

Timestamp resolution in Caplin Platform 7.1

Timestamp resolution has been increased to microsecond granularity or finer.

DataSource for Java 7.1

The table below documents timestamp granularity in DataSource for Java (DS4J) 7.1

  Timestamp Granularity
Packet log Microsecond
Event log Millisecond (see note below)
Latency chaining Nanosecond
Note: The DS4J event log is written using the java.util.logging package, which supports high-resolution timestamps from Java 9.​ Support for Java 9 will be added to DS4J in a later release.

The DS4J event log is written using the java.util.logging package, which supports microsecond timestamps from Java 9.

DataSource for Java uses Caplin's open-source Nanotime JNI extension for Java 8 to provide high-resolution timestamps. For more information, see the Nanotime repository on Caplin's GitHub site.

The method signatures for RecordMessage.setInitialLatencyChainTime and RecordMessage.addLatencyChainPoint have changed. See Breaking changes, above.

DataSource for C (DSDK) 7.1

The table below documents timestamp granularity in DataSource for C 7.1 and all applications based on DataSource for C 7.1 (Liberator 7.1 and Transformer 7.1).

  Timestamp Granularity
Packet log Microsecond
Event log Microsecond
Latency chaining Nanosecond

The function signatures for ds_add_latency_chain and ds_add_latency_chain2 have changed. See Breaking changes, above.

Liberator 7.1

See DataSource for C (DSDK) 7.1 above.

For information on the precision of Liberator's optional timestamp field, see the documentation for the global timestamp-field configuration item.


See also: