- Home
- Skills
- Trading & Investing
- trading order recovery tests
Works with the AI tools 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
- Generated the document
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.
trading-order-recovery-tests.pdf
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
What you get
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.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 13 days ago
- Passed all security checks, Safe to install