feat(client): support perps TP/SL orders#153
Open
cesarenaldi wants to merge 1 commit into
Open
Conversation
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.
Summary
Linear: https://linear.app/polymarket/issue/DEV-334/support-perps-tpsl-in-the-typescript-sdk
Verification
Note
Medium Risk
Touches signed perps trading commands and extends
createOrderswire format; mistakes could mis-place exits, but changes are additive with focused tests and ordinary orders stay on the existing path.Overview
Adds Perps take-profit/stop-loss support across bindings and the session client: new
PerpsTpSlKind/PerpsTpSlScopetypes, optionaltpSlmetadata on REST and websocket order payloads, andtpsl::lifecycle events (untriggered,armed,cancelled,expired) merged intoPerpsSessionEvent.On the client,
placeBracketOrdersubmits the entry leg plus optional TP/SL exits in one groupedcreateOrders(grp: 'order'), andplacePositionTakeProfitStopLossplaces full-position market triggers (grp: 'position'). Order encoding now supports reduce-only legs, optionaltif, andtrtrigger bodies (trp,tpsl, optionalmarket). Sessions subscribe totpslalongside existing account channels.Includes binding/client tests and patch changesets for
@polymarket/clientand@polymarket/bindings.Reviewed by Cursor Bugbot for commit c898b8a. Bugbot is set up for automated code reviews on this repo. Configure here.