AI Tools & Scripts
Crypto Trade Post-Mortem from Exchange Fills (PnL, Exits)
Read-only forensics on a crypto trade: settle which exit really fired from the exchange's own fills, prove PnL against venue fills to 1e-6, find orphaned conditional orders, and explain entries that never happened per venue.
What you get: 1 file · 15.69 KB · ZIP
See purchase optionsProduct description
When a close alert says STOP LOSS you should be able to check it. This skill gives an agent a read-only method to settle what really happened on a trade from the exchange's own records, not from your bot's label.
What is inside: - SKILL.md - the method: pull the venue's fills and conditional-order history, identify the exit by the order's text tag or conditional id, check whether the close-reason label and reported PnL are true (and why a nearest-price attribution routine can guess wrong and leave an orphaned conditional behind), reconcile PnL against fills to 1e-6 including fees, and look for leftover coins or orders on the account. - references/entry-never-happened.md - a per-venue checklist for "why did this signal open nothing here": permissions, leverage and margin mode, symbol filters, minimum notional, and refusals that look like bugs. - scripts/fills_pnl.py - recomputes PnL from fills. - scripts/price_order_time.py - places a price on the order timeline to show what the market did around each order. - scripts/gate_close_attribution.sh - read-only Gate close attribution.
For traders and developers who run their own bots across several exchanges. Needs Python 3 and read-only keys. It never places or cancels an order. Also part of the Crypto Trading Ops Playbooks pack at a lower per-skill price.
Example request
Our alert says position XYZ closed by STOP LOSS with -2.1 percent. Check from the exchange fills whether that is true and whether the PnL is right.
Example result
Example on a fictional trade (symbol ARB_USDT, account acct-a on Gate). Following trade-postmortem the agent pulled the position's fills and the finished conditional orders, read-only. The closing fill carried the text tag of the take-profit order, not the stop: the alert label STOP LOSS was wrong. The monitor's attribution picks the nearest known level by price and falls back to STOP LOSS, so it never saw the id of the order that filled.
Because that routine believed the stop had fired, it would also skip cancelling the other conditional: the agent found the stop order still open with no position behind it (an orphan) and reported it, with its id, for you to decide on cancelling. It did not cancel anything.
PnL: fills_pnl.py recomputed from the entry and close fills plus fees: -0.118382 USDT against the reported -0.118391; the difference of 9e-6 came from rounding of the fee in the alert, so the reported PnL is right to the precision shown, and the sign and size match a take-profit hit on a short that was priced above entry. Not verified: funding payments outside the window pulled.
Requirements
- Read-only API keys for the exchanges involved (Binance, OKX, Bybit, Gate, Bitget)
- Python 3 (standard library only) and bash
- Access to your service logs and the position-closed message
How to install
Unzip into your Claude Code skills folder (~/.claude/skills/ or .claude/skills/ in a project) and start a new session; the skill loads by its description.
What you get
1 file · 15.69 KB
- trade-postmortem.zipZIP · 15.69 KB
AI Tools & Scripts
Crypto Trade Post-Mortem from Exchange Fills (PnL, Exits)
Read-only forensics on a crypto trade: settle which exit really fired from the exchange's own fills, prove PnL against venue fills to 1e-6, find orphaned conditional orders, and explain entries that never happened per venue.
Getly opened the uploaded files and found nothing that would stop them opening. It is not a virus scan or a quality rating.
Tags
Frequently asked questions
Do I get access instantly?
Yes. This is a digital product - you can download it right after checkout, straight from your library.
Can I use it for commercial projects?
Yes. Commercial use is allowed: use it in your own business and in things you sell. You may not resell or redistribute the file itself.
What's your refund policy?
You can request a refund within 30 days. If something isn't right, request it from your order and the Getly team reviews it.
What file formats and sizes will I get?
You'll download 1 file - ZIP - 15.69 KB in total.
Do I get free updates?
Yes - when the seller ships a new version, you can re-download the latest files from your library at no extra cost. Check the changelog for recent updates.
Price
$7.00



