Engine Health
Description
Returns the liveness status of the spot matching engine. Intended for load-balancer and dashboard probes; no authentication required.
HTTP Request
GET /spot/health (public — no auth required)
Weight
0 — public market-data endpoints have no per-IP weight limit today (MVP).
Response Example
200 OK
{
"engine": "running",
"queue_depth": 0,
"books_loaded": 1
}
| Field | Values | Notes |
|---|---|---|
engine | running / disabled | running — engine task is alive and accepting commands. disabled — server was started with SPOT_TRADING_ENABLED=false; no matching occurs. |
queue_depth | integer | Current depth of the engine's mpsc command backlog. Healthy: 0 or single digits. Sustained high values indicate a load issue. |
books_loaded | integer | Number of in-memory order books. MVP: 1 when engine=running, 0 when engine=disabled. |
Error Responses
This endpoint always returns 200 OK. A disabled engine is reflected in the response body, not the HTTP status, so probes do not need to parse the body to detect basic reachability.
| HTTP | error |
|---|---|
500 | (internal panic — rare) |
Full list: Error Codes.
Code Examples
cURL
curl -s "https://api-sepolia.p99.world/api/v1/spot/health"
Python
import requests
BASE = "https://api-sepolia.p99.world/api/v1"
health = requests.get(f"{BASE}/spot/health").json()
print("engine:", health["engine"],
"| queue_depth:", health["queue_depth"],
"| books_loaded:", health["books_loaded"])
if health["engine"] != "running":
print("WARNING: spot engine is not running")
elif health["queue_depth"] > 100:
print("WARNING: engine queue_depth elevated:", health["queue_depth"])