TradeLabs AILearn

Clock Synchronization and PTP

Accurate clocks are vital for timestamps, latency measurement and regulation. Learn how NTP and PTP work, MiFID II and CAT clock rules and how to check your clocks.

Advanced3 min readUpdated 3 Oct 2026
Markdown
Lesson 16 of 16

Every timestamp a trading system records is only as good as the clock that produced it. Computer clocks drift, gaining or losing time every day. Without synchronisation, two servers can disagree by many milliseconds, making events appear in the wrong order, latency measurements meaningless and audit records unreliable. Regulators require firms to keep clocks within set limits of official time. The two main tools are NTP for everyday accuracy and PTP for precision measured in microseconds or better.

Why clock accuracy matters#

UseProblem with a bad clock
Ordering events across serversFills appear before the orders that caused them
Latency measurementNegative or wildly wrong latencies. See Exchange vs Receive Timestamps and Latency Measurement
Audit trailsRecords fail regulatory standards. See Logging, Audit Trails and Incident Response
Signed API requestsBrokers and exchanges reject requests with timestamps too far off
Scheduled actionsJobs run at the wrong moment

NTP versus PTP#

NTP (Network Time Protocol)PTP (Precision Time Protocol, IEEE 1588)
Typical accuracyAround a millisecond on a good network; worse over the internetSub microsecond with suitable hardware
Hardware needsNone specialNetwork cards and switches with hardware timestamping
Time sourcePublic or private NTP serversGrandmaster clock, often GPS disciplined
Typical usersMost servers, retail systemsExchanges, high frequency firms, regulated firms with strict requirements

Regulatory requirements#

RegulationRequirement (summary)
EU MiFID II (RTS 25)Clocks synchronised to UTC; for high frequency algorithmic trading, maximum divergence of 100 microseconds with 1 microsecond timestamp granularity; looser limits for other activity
US Consolidated Audit TrailIndustry member clocks synchronised within 50 milliseconds of NIST time for most systems, with tighter rules for exchanges

Firms must also document their synchronisation and be able to show traceability to UTC.

How PTP achieves precision#

  1. A grandmaster clock, usually locked to GPS or another reference, provides the time.
  2. Messages are timestamped in hardware by network cards as they leave and arrive, removing software delays.
  3. Switches correct for their own delays (boundary or transparent clocks).
  4. Clients calculate the offset and network delay from exchanged messages and adjust.

Checking your clocks on Linux#

CommandShows
timedatectl statusWhether synchronisation is active
chronyc trackingCurrent offset and stability with chrony
chronyc sources -vWhich time servers are used
ptp4l and phc2sys logsPTP synchronisation state

Chrony is a common modern NTP implementation and generally keeps time more accurately than older tools. Monitor the offset as a metric and alert if it exceeds your tolerance. See Monitoring and Logging Systems.

Best practices#

  • Use nearby, reliable time sources, several of them.
  • Never let clocks jump during trading: slew (gradually adjust) instead of stepping.
  • Monitor offsets continuously and record them.
  • Use monotonic clocks for durations and synchronised wall clocks for timestamps.
  • Store timestamps in UTC. See Timestamps, Time Zones and Daylight Saving.

Frequently asked questions#

What is PTP in trading?#

The Precision Time Protocol, which synchronises clocks across a network to sub microsecond accuracy using hardware timestamping, used by exchanges and latency sensitive firms.

Is NTP accurate enough for trading?#

For most retail and many institutional uses, yes; strict regulatory requirements for high frequency trading typically call for PTP.

What are the MiFID II clock synchronisation rules?#

Firms must synchronise to UTC within set limits, with the strictest being 100 microseconds divergence and 1 microsecond granularity for high frequency algorithmic trading.

You have finished the Infrastructure track. Continue with machine learning in Machine Learning in Trading.

Check your understanding

3 quick questions on this lesson. Get them all right to finish it.

Turn on JavaScript to take the quiz.

Finished this lesson?Sign in to save your progress across devices.

Where this leads

Mentioned in