Harden trading safety and simplify trading architecture - #3
Merged
Merged
Conversation
wraithioner
marked this pull request as ready for review
October 3, 2026 00:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trading failures could repeat a spend, miss a copied event, use a wallet after reset, or report profit against the wrong remaining cost basis. This PR strengthens trading safeguards and gives manual, copied and automated trades shared accounting in focused modules.
Changes
Validation
npm run checkpassed on Node 24.19.0. GitHub Actions passed the full format/lint/typecheck/test pipeline on Node 22 and 24 (run).Tradeoffs and remaining work
The stricter holder bound and builder checks can refuse otherwise valid trades. Durable copy claims favor avoiding repeat spending; a crash after the claim can miss a copy.
Full CPI swap-intent decoding and a durable per-wallet submission journal remain priorities. An unresolved signed transaction can land after the in-process execution gate releases. PumpPortal's current opaque wrapper remains a trust dependency. Non-ATA sells may require consolidation, execution is process-local, and unfamiliar/composed history remains incomplete. The remaining audit findings derive from one unpatched bigint-buffer advisory.
See DEEP_REVIEW.md for reproductions, primary sources, compatibility evidence and remaining work. No production deployment or live trade was performed.