Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    trading order recovery tests

    1

    Replay and audit trading order events to identify duplicate fills, race conditions, and unresolved broker states.

    $18

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    trading order recovery tests

    trading order recovery tests

    Example session with this skill installed

    Analyze the order event logs in log_export_20231012.json to identify any duplicate fills or unresolved states during the 09:30 AM reconnect window.

    • Read your context and instructions
    • Compiled the trading order recovery

    I have processed the provided order event logs through the replay helper. The analysis identified one duplicate fill notification and one unresolved state caused by a race between a cancel request and a late execution report.

    Order Recovery Analysis Report

    Order IDIntentDetected EventsStatusConflict/Finding
    ORD-99281BUY 500 AAPLSUBMIT, RECONNECT, FILL, FILLRESOLVEDDuplicate fill notification flagged at 09:31:04. Position count corrected.
    ORD-99285SELL 200 TSLASUBMIT, CANCEL_REQ, FILL, CANCEL_ACKUNRESOLVEDRace condition: Fill received after cancel request, followed by Cancel Ack. Requires broker side check.
    ORD-99302BUY 100 MSFTSUBMIT, RECONNECT, ACKSUCCESSNormal recovery after connection loss.

    Technical Findings

    The replay tool flagged ORD-99285 because the state machine reached a terminal 'Filled' state before receiving a 'Canceled' acknowledgement. This suggests the venue processed the fill before the cancel message arrived, despite the local sequence. Application logic should be reviewed to handle CANCEL_ACK arriving post-fill without throwing a state transition error.

    Data References:

    • Source: log_export_20231012.json
    • Helper Version: 1.0.2-offline
    • Script: scripts/analyze.py

    Next steps

    1. Manually verify the execution status of ORD-99285 via the broker's administrative portal.
    2. Update the application's order state machine to gracefully ignore CANCEL_ACK if the order is already in a terminal FILLED state.
    3. Add the ORD-99285 sequence to the synthetic test suite to prevent regression.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    Race conditions between order fills and cancellations often lead to duplicate position tracking or hung states. Manually auditing event logs to identify where a recovery logic failed during a reconnect or timeout is slow and error-prone.

    What it does

    • Replays recorded order-event fixtures to detect duplicate broker notifications and fill replays.
    • Correlates asynchronous event sequences into single economic order intents for clear auditing.
    • Identifies terminal-state conflicts where transport reordering causes illegal state transitions.
    • Flags unresolved broker states that require manual intervention or logic updates.

    Frameworks & tools

    Python 3 for analysis scripts, JSON for event fixture schemas, and isolated application test harnesses.

    Why this beats prompting it yourself

    General LLMs struggle with the strict state machine logic required for trading order lifecycles. This skill uses a defined model for handling complex races like ack-after-fill or partial-fill-during-cancel, ensuring technical accuracy over vague summaries.

    Use cases

    • Analyzing logs after a production reconnect event to check for missed fills.
    • Validating new order-management logic against synthetic failure injection fixtures.
    • Generating incident reports for broker state discrepancies.

    Known limitations

    Strictly an offline replay checker. It does not provide broker clients, automatic retries, or production recovery automation.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Trading & Investing.

    Requires mapping external logs to the specific input contract. No support for live broker APIs, automated retries, or complex replacement-chain engines.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Software
    Python

    Permissions

    Terminal / Shell
    Listed1 month ago

    What's inside

    Frequently Asked Questions

    This skill acts as an offline audit layer that replays trading event logs to identify complex issues like duplicate fills and race conditions that occur during connection drops or broker timeouts.

    The skill is designed for use with AI agents that support Python execution environments and can process JSON-based data structures or log exports.

    You will receive a set of specialized analysis scripts, standardized JSON schemas for event fixtures, and a structured test harness for running simulations.

    While it does not connect to live brokers, it is designed to ingest and analyze standard order event data from any exchange or broker that provides structured event logs.

    No, this is strictly a diagnostic tool for offline replay and auditing; it does not execute live trades or perform automated recovery actions in a production environment.

    Setup involves mapping your trading logs to the provided JSON event schema and integrating the Python scripts into your agent's local testing or auditing environment.

    New in Trading & Investing