Monitoring & Alerts
What to monitor and alert on for market makers.
Health Checks
API Health
Endpoint: GET /health
Response: {"status":"ok"}
Readiness: GET /ready returns {"status":"ready","components":[...]} with a per-component ready flag. Use it to tell a reachable but not yet serving API from a healthy one.
Monitoring: Check every 30-60 seconds
Alert: If health check fails, API server may be down
WebSocket Connection
Monitoring: Track WebSocket connection status
Alert: If connection drops, reconnect immediately
Best practice: Implement exponential backoff on reconnect
Order Monitoring
Rejection Rate
Metric: Percentage of orders rejected
Alert: If rejection rate > 5%, investigate:
- Margin issues
- Tier restrictions
- Expired instruments
- System overload
Fill Rate
Metric: Percentage of orders filled
Alert: If fill rate drops significantly, investigate:
- Market conditions
- Quote competitiveness
- Orderbook depth
Order Latency
Metric: Time from order placement to fill/ack
Alert: If latency > 1s, investigate:
- System overload
- Network issues
- Engine processing delays
Portfolio Monitoring
Margin Usage
Metric: margin utilization from margin_summary in GET /portfolio?wallet=.... margin_summary.initial_margin and margin_summary.maintenance_margin are headroom (what is left after requirements), not margin in use. Compute utilization against the basis that actually supports margin in each mode:
margin_summary.mode | Basis | Initial margin headroom | Maintenance margin headroom |
|---|---|---|---|
portfolio | equity | initial_margin | maintenance_margin |
standard | standard_margin.cash_margin | standard_margin.initial_margin_headroom | standard_margin.maintenance_margin_headroom |
im_utilization = (basis - initial_margin_headroom) / basis
mm_utilization = (basis - maintenance_margin_headroom) / basis
Treat a basis of zero or less as 100% utilized.
Alert: If initial margin utilization > 80%, new orders are close to rejection. If maintenance margin utilization approaches 100%, the account is close to liquidation. Consider:
- Reducing position size
- Adding collateral
- Closing positions
Free Collateral
Metric: available_balance from GET /portfolio?wallet=.... This is free collateral for new trades, not the USDC cash balance. Option marks, perp PnL, and margin requirements move it without any cash changing hands. For the amount you can withdraw, use withdrawable_usdc.
Alert: If free collateral < threshold, reduce risk or deposit funds
MMP Monitoring
MMP Triggers
Metric: Number of MMP triggers per hour
Alert: If MMP triggers frequently, consider:
- Increasing MMP limits
- Reducing quoting frequency
- Reviewing fill patterns
MMP Cancel Rate
Metric: Percentage of orders canceled by MMP
Alert: If MMP cancel rate > 10%, review MMP configuration
System Monitoring
API Response Times
Metric: P50, P95, P99 response times
Alert: If P95 > 500ms, investigate system load
WebSocket Message Rate
Metric: Messages per second on WebSocket
Alert: If message rate spikes, investigate:
- Market volatility
- System overload
- Message processing delays
Recommended Alerts
- Health check failure: API server down
- High rejection rate: > 5% orders rejected
- Low fill rate: < 50% orders filled (context-dependent)
- High margin usage: > 80% margin used
- MMP triggers: > 5 triggers per hour
- WebSocket disconnect: Connection lost
- High latency: P95 > 500ms
Monitoring Tools
Recommended:
- Health check endpoint for uptime monitoring
- WebSocket connection status tracking
- Order/fill reconciliation for accuracy
- Portfolio margin tracking
Current: No built-in monitoring dashboard. Use external tools (e.g., Prometheus, Grafana).