post-trade-verify
Verify a trade after it confirms: receipt, the balance before and after (the only measurement), the bought token at the intended address, the measured amount beside the quote, leftover allowances, the simulated book size, and reconcile. A tx hash is not proof.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 12
- Forks
- 2
01 前言 Front Matter
- name
- post-trade-verify
- license
- MIT
- metadata
- { "polyrob-when": "Checking a trade after it confirms", "polyrob-version": "5", "polyrob-priority": "2", "polyrob-triggers": "{\"tool_ids\":[\"defi_trade\",\"defi_data\"]}" }
- description
- Verify a trade after it confirms: receipt, the balance before and after (the only measurement), the bought token at the intended address, the measured amount beside the quote, leftover allowances, the simulated book size, and reconcile. A tx hash is not proof.
03 SKILL.md 正文
Post-Trade Verify — a tx hash is not proof
Run this after every RESULT: CONFIRMED. A trade is finished when you have
MEASURED what arrived, not when the transaction was sent.
What the code gives you
EVM swap and Solana solana_swap: the result names the tx hash (EVM: the
block; Solana: sig:), the quoted output and the minimum. A CONFIRMED swap
writes the position book from the guard's SIMULATED balance change, never from
the token's own Transfer events: positions labels that size SIMULATED balance change, final fill not measured. A swap between working-capital assets (USDC ↔
the wrapped native) writes no position. A reverted or unconfirmed swap writes
nothing. No tool reports a measured fill: the only measurement is the
portfolio balance before and after (step 2).
Never substitute the QUOTE for a measurement you do not have. Unmeasured is unknown.
The procedure
- Receipt.
CONFIRMED(a block number on EVM, asig:on Solana).BROADCAST BUT NOT CONFIRMEDispending, never failed — check again before you conclude anything. - Balance delta.
defi_data.portfolio(chain=…)before AND after the trade — on every chain this delta is the only measurement you have. The token you bought must appear at the ADDRESS you intended (read the address, not the symbol — seetoken-identity). If a collision warning appears, stop. - Fill vs quote. Put the measured amount that arrived beside the quoted
output and the minimum, as the tools printed them, with the gas you paid. A
measured amount below the minimum is a defect to report. Do not compute a
fill price or a USD figure yourself: the rail book's basis for the position
is in
defi_data.positions, and that is the cost you report. - Leftovers. An allowance you granted for a one-off trade: revoke it.
Dust left in
token_in: record it; do not chase it. - Check the book (see
position-journal):defi_data.positions(chain=…)shows the position at the address with its size and basis (orunknown). It also says where its size came from:SIMULATED balance change, final fill not measured(every swap now),QUOTED size, not measured, orlegacy Transfer events, unverified quantity(older rows). None of these is a measurement. Report the tx hash, the MEASURED quantity (the chain delta — never the quote and never a "fill" a tool result reported), and the reason for the trade. - Reconcile when anything looked off:
defi_data.reconcile(chain=…). Its verdict is authoritative over your memory.
Honest reporting
- Report what was measured. "Bought 0.5 ETH of X" without a measured receipt is a claim, not a result.
- A figure you could not read is UNKNOWN — say so; never report it as zero.
- Name the contract address in any public claim about a trade.
If a tool is missing
Follow harness-manual; do the read steps you can, and never work around a
missing verb with a raw call, a browser dapp or another agent.
Related
trade-execution, position-journal, exits.
04 同仓库更多 Skills
echo-basics
How to use the echo tool from the echo fixture pack.
x-engagement
Operate X account communication on the API rail (the captured-browser rail only where the owner chose it)—read inboxes, post/reply, send DMs, set up the account, with the real write gates and completion evidence
social-discovery
Discover public X/social accounts and conversations with AnySite first (anysite_describe, then anysite_api), using native X account reads where they are authoritative and preserving write gates
polymarket-trading
GATED: place/cancel Polymarket orders. Owner-only, read-first, >$500 confirmation gate; references crypto-trading-safety
polymarket-portfolio-review
Read the configured Polymarket account's positions and trade history from the public Data API (no address parameter); summarize exposure and P&L
polymarket-market-research
Read Polymarket markets (discover, details, price as implied probability, orderbook, spread, volume) with no wallet