Inspiration

APIs fail silently — dashboards show up/down, but drift kills users first. Inspired by prediction-market math that spots stale quotes in milliseconds, we built a fleet that spots drift in any API before it becomes downtime — human-first, explainable.

What it does

API Sentinel Fleet polls N endpoints every 8s, scores each with a 3-model ensemble (latency-z vs rolling median, momentum tilt, staleness HEALTHY → WARN → FAILOVER), and triggers human-centric failover + alerts when edge crosses the band. Generalized from predictrader-ai: loadMarkets() → loadEndpoints(), fetchOrderBook() → fetchAPIHealth(), SpotHistory → LatencyHistory — same Φ k=√2/π, 120-sample ring.

Live: https://api-sentinel-fleet.vercel.app · GitHub: https://github.com/binasalama12/api-sentinel-fleet

How we built it

  • Stack: Next.js 14, TypeScript, Node fetch, viem patterns, Docker (Cloud Run node:20-slim, non-root, $PORT), OpenAPI 3.1 (5 routes, X-Fleet-Key)
  • Infra: Vercel + Cloud Run, horizontal fleet scaling — one fleet hits API + Cloud + AI
  • Agent fit: AWS Bedrock AgentCore / Strands SDK compatible — ensemble as agent reasoning + tool-calling for failover, RAG-ready for runbooks
  • Demo-safe: DEMO_FALLBACK keeps dashboard live even when endpoints idle

Challenges we ran into

Generalizing trading drift math to latency without losing signal — z-score and 35% muzzle recalibration. Wiring openapi.yaml X-Fleet-Key to handlers (declared, not yet enforced).

Accomplishments that we're proud of

  • One fleet, 3 human-centric tracks — max EV from single build; 5 sentinels shipped from 1 base, all live 200
  • Clean OpenAPI + Dockerfile for sponsor brownie points
  • AWS-ready: AgentCore/Strands friendly (tool calling + RAG)

What we learned

Trading infra is API infra. Human-in-the-loop failover beats auto-everything for trust. Sponsor-track thinking > single-track.

What's next

Wire X-Fleet-Key, add PagerDuty/Slack on FAILOVER, and Strands SDK tool definitions for auto-remediation. PRs at binasalama12/api-sentinel-fleet.

Built With

Share this project:

Updates

Submission history