alpaca-broker-reconciliation-idempotency

Manage local state convergence with the Alpaca Broker API via idempotent processing and reconciliation.

108|11|Updated Jun 16, 2026
One-click install
npx skills add https://github.com/alpacahq/alpaca-skills --skill alpaca-broker-reconciliation-idempotency
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: alpaca-broker-reconciliation-idempotency
Source: https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/reconciliation-idempotency
Command: npx skills add https://github.com/alpacahq/alpaca-skills --skill alpaca-broker-reconciliation-idempotency

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill ensures local state remains accurate against the Alpaca Broker API by handling idempotency keys, upserts, event deduplication, polling, reconciliation, and handling eventual consistency and corrections.

Core Features & Use Cases

  • Idempotent Writes: Safely retry money and order writes without duplicates.
  • Event Intake: Process replayed/duplicate events without doubling processing.
  • Reconciliation Sweep: Regularly pull authoritative state from Alpaca for local convergence.
  • Polling Rails: Poll for events from APIs that do not emit events.
  • Status State-Machine Mapping: Map Alpaca statuses to internal states.
  • Eventual Consistency Handling: Design for eventual consistency and corrections.
  • Use Case: Use this Skill to build a robust data-correctness layer for any Alpaca integration.

Quick Start

Use the 'alpaca-broker-reconciliation-idempotency' skill to perform a reconciliation sweep for all accounts.

Frequently Asked Questions about alpaca-broker-reconciliation-idempotency

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle duplicate events from the Alpaca Broker API?

Duplicate events from the Alpaca Broker API are handled through event deduplication and idempotent processing, ensuring replayed events do not result in doubled local processing or duplicate state changes.

What is a reconciliation sweep for Alpaca Broker API integrations?

A reconciliation sweep regularly pulls authoritative state from the Alpaca Broker API to ensure local convergence, correcting any drift between your local database and the remote system.

How do I safely retry money and order writes against the Alpaca Broker API?

You can safely retry money and order writes by using idempotency keys, which prevent duplicate financial transactions or order submissions during network timeouts or retries.

How do I map Alpaca Broker API statuses to internal application states?

Mapping Alpaca Broker API statuses to internal states is achieved through a status state-machine mapping process, translating external event statuses into your application's internal state representation.

Does the Alpaca Broker API support polling for APIs that do not emit events?

Yes, polling rails are used to pull events from Alpaca Broker APIs that do not emit events, ensuring your local system captures all necessary state changes reliably.

How do I design for eventual consistency when integrating with the Alpaca Broker API?

Designing for eventual consistency with the Alpaca Broker API involves implementing reconciliation jobs and corrections to handle delayed state updates and maintain accurate local data.