LatencyProfiler
LatencyProfiler continuously measures round-trip order submission latency by route and surfaces regressions.
What it does
LatencyProfiler continuously measures round-trip order submission latency by route and surfaces regressions. It probes each configured route at probe_interval_s and emits ObservationReports when p95 or p99 thresholds are breached.
Pipeline placement
Applies to: All CLOB V2 order submission and ws feed routes continuously
Why it matters
| If this fails | Consequence |
|---|---|
| Latency regression undetected | Strategy signals age past their TTL in transit, causing stale-signal discards and missed opportunities without a clear root cause. |
| Route not profiled per endpoint | A degraded CLOB endpoint continues to receive orders because the routing layer lacks per-route latency data. |
| WebSocket lag not tracked | ws_user fill events arrive late, causing order lifecycle state to be updated with significant delay. |
Inputs
Polymarket inputs
| Input | Source | Required | Use |
|---|---|---|---|
| CLOB V2 order submission endpoint (probe orders) | clob_auth | required | Measure submit-to-ack latency per endpoint. |
| WebSocket user feed heartbeat | ws_user | required | Measure ws feed lag by comparing heartbeat timestamp to local clock. |
Internal inputs
| Input | Source | Required | Use |
|---|---|---|---|
| Probe trigger from scheduler | internal scheduler | required | Trigger a latency probe on each configured route every probe_interval_s. |
Authority
What this bot is permitted to do
State
Readiness
Spec started
Status
planned
Class
Execution Utility
Default mode
shadow_only
Developer owner
Polytraders core — Execution pod
Capital impact
Direct
Reason codes emitted
| Code | Severity | Meaning | Action |
|---|---|---|---|
| LATENCY_OK | INFO | All probed routes within p95 and p99 thresholds. | No alert; emit metrics only. |
| LATENCY_WARN | WARN | p95 latency exceeded warn_p95_ms on a probed route. | Emit ObservationReport with WARN; do not block orders. |
| LATENCY_HARD_BREACH | HARD_REJECT | p99 latency exceeded fail_p99_ms; route flagged as degraded. | Flag route degraded; notify exec bots; alert ops. |
| PROBE_TIMEOUT | WARN | Probe request timed out; recorded as max latency (1000ms) in rolling window. | Record max latency; check for 3 consecutive timeouts before HARD_REJECT. |
Related bots in Execution
Used by
Reverse index — strategies that currently reference exec.latencyprofiler. If you change this bot's authority or reason codes, these strategies must re-pass shadow.
| Strategy | State | Activity |
|---|---|---|
| Fed Rates — surprise drift | frozen | last triggered 22m ago |
| AI Frontier — release-day taker | frozen | last triggered 29m ago |
| NBA props — line-shop | demo-wired | last triggered 36m ago |
Showing 3 of 3 · demo-wired ≠ production-live
Why this matters
Execution bots does NOT propose new positions; only routes and shapes approved intents. Understanding the authority boundary prevents misuse and makes promotion-gate reviews faster and more reliable. View raw spec JSON →