- Home
- Skills
- Trading & Investing
- trading order recovery tests
Works with the AI Agents you already use
trading order recovery tests
Replay and audit trading order events to identify duplicate fills, race conditions, and unresolved broker states.
$18
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 ID | Intent | Detected Events | Status | Conflict/Finding |
|---|---|---|---|---|
ORD-99281 | BUY 500 AAPL | SUBMIT, RECONNECT, FILL, FILL | RESOLVED | Duplicate fill notification flagged at 09:31:04. Position count corrected. |
ORD-99285 | SELL 200 TSLA | SUBMIT, CANCEL_REQ, FILL, CANCEL_ACK | UNRESOLVED | Race condition: Fill received after cancel request, followed by Cancel Ack. Requires broker side check. |
ORD-99302 | BUY 100 MSFT | SUBMIT, RECONNECT, ACK | SUCCESS | Normal 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
- Manually verify the execution status of
ORD-99285via the broker's administrative portal. - Update the application's order state machine to gracefully ignore
CANCEL_ACKif the order is already in a terminalFILLEDstate. - Add the
ORD-99285sequence 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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