Verify transaction outcomes
Connect user intent, successful execution, and reconciled state changes.
A signature identifies a submitted transaction; a successful result and its account changes establish what happened. Your application should distinguish pending, rejected, and settled operations.
Establish success before reading effects
Use the transaction's result and the commitment level required by your application. Logs and inner instructions may survive in the record of a failed transaction even though its state changes were rolled back. Never credit volume, fees, or rewards from a callback log alone.
Reconcile the operation
| Operation | Inspect after success |
|---|---|
| Swap | Actual input, net output, fee destinations, price and liquidity |
| Liquidity change | Position liquidity, principal transfers, ticks, fee checkpoints |
| Fee collection | Position, protocol, or beneficiary claim and corresponding token credit |
| Graduation | Pool mode, creator position, price continuity, recorded remainder |
| Reward issuance | Eligible settled output, recipient balance, issuance counter, sponsor cost |
Compare these effects with the user's limits and the expected account identities. Token amounts use atoms; formatting belongs at the presentation boundary.
Keep failure atomic
A denied callback, malformed reply, insufficient budget, or failed nested CPI must not leave partial settlement. Check the pool, tick pages, positions, token balances, and any hook-controlled state together. Network transaction fees can still be charged for failed execution.
Make observations reproducible
Record the program/interface version, pool, operation, relevant slot, and snapshot needed to explain a result. Protect private application data and signing secrets. Where pricing is involved, compare deterministic integer calculations with an independent model as well as shared quote code.
The core does not currently expose a typed Anchor event schema. Build observers around successful transactions and authoritative account state, and account for finality in your indexing strategy. Continue with invariants and integration validation.