What problem does it solve? Alpaca is an asynchronous, eventually-consistent system where writes settle later, events can be missed or replayed, and some rails emit no events at all. This Skill prevents duplicate money movement, missed events, and drifting local state by making your database a self-healing mirror of Alpaca's authoritative state. ## Core Features & Use Cases - Three-layer correctness architecture: idempotent writes with client order IDs and Idempotency-Key headers, idempotent event intake keyed on event_id, and nightly reconciliation sweeps that re-pull and upsert authoritative state. - Polling and status mapping: poll rails with no SSE events (funding-wallet transfers, classic wire transfers) only for non-terminal records, and map Alpaca status enums to internal states with terminal-aware, unknown-tolerant handling. - Use Case: You are building a brokerage app on the Alpaca Broker API and need to guarantee that a retried journal never double-moves money, a replayed SSE event never re-fires a payout, and a missed event during a deploy is backfilled by a nightly heal job over trade activities, journals, and transfers. ## Quick Start Use this skill to design the idempotency, event deduplication, and nightly reconciliation layer for my Alpaca Broker API integration.