Check Time at the Host
A request can carry a valid signature and an unacceptable timestamp. Increasing its receive window may help a delayed request, but it cannot fix every clock or routing error. Some exchanges also limit how far into the future a timestamp may be.
Start with the returned error and the actual endpoint. A signature mismatch, invalid key, and timestamp rejection need different investigations.
Inspect the host's clock synchronization before adding an application offset. Containers normally use the host's clock, so changing a container's timezone does not repair an incorrect UTC epoch timestamp.
Check units at the signer boundary. Milliseconds, seconds, and ISO strings are not interchangeable. A number that looks plausible in a log can be wrong by a factor of one thousand.
Measure an Offset
A server-time read can estimate the difference between the server clock and the midpoint of a local request. This public Binance example collects three samples:
clock-samples.mjs
import { performance } from 'node:perf_hooks';
import { MainClient } from 'binance';
const client = new MainClient();
const samples = [];
for (let attempt = 0; attempt < 3; attempt++) {
const wallStart = Date.now();
const monotonicStart = performance.now();
const result = await client.getServerTime();
const rttMs = performance.now() - monotonicStart;
const wallEnd = Date.now();
if (Math.abs(wallEnd - wallStart - rttMs) > 100) {
throw new Error('Wall clock changed during the sample');
}
samples.push({
rttMs,
estimatedOffsetMs: result - (wallStart + wallEnd) / 2,
});
}
console.table(samples.sort((a, b) => a.rttMs - b.rttMs));
The lowest round-trip sample reduces some queuing noise. It does not remove asymmetric network delay or prove that the midpoint equals the server's measurement instant. Do not install the noisiest sample as a permanent clock correction.
Understand the Receive Window
Bybit's timestamp rule includes both a permitted age and a bound on future timestamps. A larger recv_window does not expand every side of that rule.
Measure how long a signed request waits between signing and dispatch. A request queue can consume its validity window before network transmission begins. Sign near dispatch and re-evaluate queued work rather than storing a signed request for later replay.
Configure the Relevant Client
The Binance client exposes disableTimeSync; Bybit exposes enable_time_sync. They are different options with different defaults. Use the installed SDK's documentation rather than assuming one flag applies across packages.
Fix host synchronization first, then evaluate any client offset against measured behaviour. Keep failures visible if time sampling itself becomes unreliable. For an order with a lost response, changing the clock does not resolve whether it was accepted: use order reconciliation before another placement.
Related articles
Continue from here