pnclENGINEGet API access

CAPACITY NOTES

Your pipeline runs on your clock: keep it honest

Snapshot age, close capture and backoff all trust your server's clock. How to measure the skew against the feed and keep it under a second.

Your odds pipeline is a clock-driven machine. The snapshot-age metric that tells you a board is stale, the close-capture job that marks the last prematch price, even the backoff that waits out a 429: all of them trust your server's clock. If that clock drifts, every time-based judgment drifts with it, silently. Keeping the clock honest is a five-minute setup with a measurable check.

Where the clock bites

The monitoring guide computes snapshot age as seconds since the last valid poll, and the storage guide stores observed_at for every price change. A clock two minutes slow reports a fresh board as stale; a clock two minutes fast marks the close early. Neither throws an error. Both corrupt the records your future self will trust.

The worst part is the silence: skewed clocks fail nothing, so they fail you only in hindsight.

Measure the skew against the feed

Every HTTP response carries the server's Date header, so every poll is a free clock check. Parse the header, compare it with your local time, and log the difference:

from email.utils import parsedate_to_datetime
from datetime import datetime, timezone

server = parsedate_to_datetime(r.headers["Date"])
skew = (datetime.now(timezone.utc) - server).total_seconds()

Under a second of skew, forget it. Over a few seconds, fix the clock before you trust the pipeline's timestamps, because the freshness math downstream assumes both ends agree on what now means.

Fix it once, then watch it

NTP is the fix: a synced system clock drifts by milliseconds, not minutes. Add the skew reading to your health checks, alongside the pipeline metrics you already track, and alert when it passes a second or two. The monitoring guide's own posture applies: measure the number, alert on the threshold, never eyeball it.

On containers and small VPSes, clock discipline is the first thing that breaks after a suspend or a long pause, which is why the skew check belongs in the pipeline, not in a wiki page.

Why it matters for the close

The closing price is the last prematch row before the start, and an early or late clock moves the close. A pipeline that grades itself against closes, as the CLV workflows on this network's other sites do, inherits the error directly. One second of clock accuracy is cheap; a mislabeled close is forever.

Sync the clock, measure the skew on every poll, alert past a second. Then every timestamp in your store means what it says.