Cross-venue sanity: BTC/BRL
Loading…
How the probe works
A Cloudflare Durable Object alarm fires every 60 seconds. For each gateway it opens a WebSocket, sends Ping, GetInstruments and SubscribeLevel1, and writes the result to D1. State changes become events: down after 2 failed probes, recovered, a pair leaving Running against the recorded baseline, a crossed book, ping above 3x baseline for 3 probes.
Uptime here is probe success from one cloud vantage. "Probe from your browser" adds a second vantage to split gateway faults from path faults.
Live market-data feed
Opens a WebSocket from this browser to the gateway and subscribes to Level 1 and trades on the primary pair. Frame rate and time since the last update show whether the feed is flowing; the raw frames show exactly what the gateway sent.
| Time | Taker | Price | Qty | Age |
|---|---|---|---|---|
| Not connected. | ||||
Raw frames (newest first)
Not connected.
Events
Raised automatically by the probe worker on state changes. Nothing here is written by hand.
| When | Gateway | Sev | Kind | Detail |
|---|---|---|---|---|
| Loading… | ||||
Host triage
Run the read-only snapshot on a Debian host, Proxmox node or pfSense box, paste the output, and get findings ranked P1 to P3 with the first safe command for each. The scripts change nothing.
Snapshot output
Result
| Sev | Finding | Evidence | First safe action | Log it |
|---|---|---|---|---|
| No findings yet. | ||||
Shift log & handoff
Every action gets a timestamp in NY time and UTC as it happens. At 09:00 EST the log becomes a handoff the day shift can act on without asking a question.
Add an entry
Handoff note
Log entries, then Generate.
Integrations
The same data is exposed for existing tooling: Prometheus scrape format, JSON APIs, and alert rules that match the events above.
Live /metrics
Loading…
Prometheus alert rules
groups:
- name: apex-gateways
rules:
- alert: ApexGatewayDown
expr: apex_gateway_up == 0
for: 2m
labels: { severity: P1 }
annotations:
summary: "{{ $labels.venue }} gateway unreachable"
runbook: "Probe from a second vantage, then page on-call"
- alert: ApexProbeAbsent
expr: time() - apex_probe_timestamp_seconds > 300
labels: { severity: P2 }
annotations:
summary: "No probe for {{ $labels.venue }} in 5m (monitor is blind)"
- alert: ApexInstrumentStateChanged
expr: changes(apex_instruments_not_running[10m]) > 0
labels: { severity: P1 }
annotations:
summary: "Instrument left or rejoined Running on {{ $labels.venue }}"
- alert: ApexCrossedBook
expr: apex_level1_spread_bps < 0
for: 1m
labels: { severity: P1 }
- alert: ApexLatencyHigh
expr: apex_gateway_ping_ms > 3 * avg_over_time(apex_gateway_ping_ms[1h])
and apex_gateway_ping_ms > 1000
for: 3m
labels: { severity: P2 }
API
curl -s /api/fleet | jq '.gateways[] | {id, uptime_24h, p50_ping, latest: .latest.ok}'
curl -s "/api/events?hours=8" | jq '.events[] | select(.sev=="P1")'
curl -s "/api/probes?gw=ndax" # last 120 raw probe rows
curl -s "/api/edge-probe?gw=wss://api.ndax.io/WSGateway/" # on-demand probe from the edge
About
Built by Edward Tay as a work sample for the AlphaPoint Tech Ops Engineer (overnight) application. It is my own tool. It has no access to any AlphaPoint or customer system and uses only public, unauthenticated gateway calls: Ping, GetInstruments, SubscribeLevel1, SubscribeTrades. No keys, no orders.
| Part | How it runs |
|---|---|
| Probe worker | Cloudflare Worker with a 1-minute cron trigger. Probes all gateways in parallel, 8 s connect timeout, results and events in Cloudflare D1, 14-day retention. |
| Gateways | NDAX and Coinext are named as AlphaPoint customers in AlphaPoint-linked press and case studies. Foxbit and Bitazza are listed because their public gateways answer the APEX frame format; that is the only claim made about them. |
| Alert logic | Down after 2 consecutive failures. Instrument alerts diff against a recorded baseline, because delisted pairs stay Stopped permanently (Bitazza lists 34). Latency alerts need 3 probes above 3x an EWMA baseline. |
| Host triage | Runs in the browser; pasted output never leaves the page. ap-health.sh was tested on Ubuntu 24.04 with Docker. The MySQL, Proxmox and pfSense branches use documented command output formats and ship with samples. |
| Limits | One cloud vantage for recorded history. Probe success measures gateway reachability and API answers, which is narrower than customer-facing uptime. |
Write-up: alphapoint-techops.edwardtay.com