AI Tools & Scripts
Trading Service Latency Instrumentation and Diagnosis
Add a per-trade timing ledger (signal to order to fill to protected) to a crypto trading service, then diagnose jumpy RTT, slow feed hops and single slow fills with playbooks and dependency-free probes.
What you get: 1 file · 25.89 KB · ZIP
See purchase optionsProduct description
Answer the question that averages cannot: for this trade, where did the time go?
What is inside:
- SKILL.md: how to build a per-trade ledger in a trading service and its exchange client, in an order where partial work is shippable (additive stamps first, ack capture last because it touches live order flow). It lists the five traps that give confident but wrong numbers, such as mixing clocks and mixing accept with ack.
- references/: five playbooks. Latency jumps (per-flow path pinning versus queueing), feed-ingress attribution (clock offset, network, your read path or the vendor), socket warmth, single-fill diagnosis from logs plus the exchange's fill history, and live-box measurement pitfalls.
- scripts/ws_probe.py: dependency-free WebSocket ping/pong probe with percentiles and clock offset.
- scripts/pcap_turnaround.py: reads a packet capture to measure how fast a peer answers, with its jitter bound.
It is for developers who run their own crypto execution code and want evidence before blaming the exchange, the network or themselves. It needs a codebase you can edit, a way to restart the service, and Python 3 for the probes. The ledger work is done inline in one thread, since the risk sits in one message-router function.
This skill is also part of the Crypto Listing & Announcement Research Kit pack at a lower per-skill price.
Example request
One of my entries filled 900 ms after the signal and I do not know why. Walk me through finding whether it was our code, the network or the exchange, and add the timing ledger to my Go trading service.
Example result
Example output on a fictional setup (illustrative).
Single-fill diagnosis, following references/single-fill-diagnosis.md: 1. Collected the signal stamp, our read-loop arrival stamp, order send time and the exchange's own fill time from its fill history. 2. Clock check first: ws_probe.py reported our clock offset to the exchange as +3 ms, so cross-host subtraction is usable to about that precision. 3. Split of the delay: signal to our arrival 40 ms (feed hop), arrival to order send 12 ms (our code), send to exchange accept 610 ms (ack late), accept to fill 4 ms. The big block sits between send and accept. 4. Socket warmth check: the order socket had been idle for 11 minutes; the first message after idle paid a new TLS and path setup. Matches the playbook.
Verdict: not our logic, not the matching engine; a cold order socket. Fix: keep-alive pings on the order socket and a warm-up message before expected signals.
Ledger plan: stamp the read loop, add timing fields to the order-update struct, build the ledger package, render ack=unknown until ack capture lands, build and vet both modules, then ack capture last.
Requirements
- Python 3 (standard library only) for the probes
- A trading service and exchange client you can edit (examples are Go-flavoured, rules apply to any language with a monotonic clock)
- Optional: tcpdump on your box for the packet-capture script
How to install
Unzip into your Claude Code skills folder (~/.claude/skills/ or .claude/skills/ in a project) and start a new session; the skill loads by its description.
What you get
1 file · 25.89 KB
- latency-instrumentation.zipZIP · 25.89 KB
AI Tools & Scripts
Trading Service Latency Instrumentation and Diagnosis
Add a per-trade timing ledger (signal to order to fill to protected) to a crypto trading service, then diagnose jumpy RTT, slow feed hops and single slow fills with playbooks and dependency-free probes.
Tags
Frequently asked questions
Do I get access instantly?
Yes. This is a digital product - you can download it right after checkout, straight from your library.
Can I use it for commercial projects?
Yes. Commercial use is allowed: use it in your own business and in things you sell. You may not resell or redistribute the file itself.
What's your refund policy?
You can request a refund within 30 days. If something isn't right, request it from your order and the Getly team reviews it.
What file formats and sizes will I get?
You'll download 1 file - ZIP - 25.89 KB in total.
Do I get free updates?
Yes - when the seller ships a new version, you can re-download the latest files from your library at no extra cost. Check the changelog for recent updates.
Price
$7.00



