Skip to content

feat(perps): guard position protection updates and return receipts - #10644

Merged
abretonc7s merged 28 commits into
feat/lighter-native-trigger-ordersfrom
feat/lighter-position-protection-guards
Oct 2, 2026
Merged

abretonc7s merged 28 commits into
feat/lighter-native-trigger-ordersfrom
feat/lighter-position-protection-guards

Conversation

@abretonc7s

@abretonc7s abretonc7s commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

A position can change size, reverse or close while a user signs a stop-loss or take-profit update.

Check expectedPosition, when provided, before updating protection on either provider. Return confirmed child order IDs and leave uncertain submissions unresolved. If a Hyperliquid replacement fails, attempt to restore the original protection and report any loss.

Refused removals preserve surviving protection instead of resuming cancellation during recovery.

Package tests, build and static checks pass. Final Mobile integration and testnet validation are pending.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and prepared draft consumer PRs

@abretonc7s abretonc7s self-assigned this Oct 1, 2026
@abretonc7s
abretonc7s marked this pull request as ready for review October 1, 2026 07:29
@abretonc7s
abretonc7s requested review from a team as code owners October 1, 2026 07:29
@abretonc7s
abretonc7s force-pushed the feat/lighter-native-trigger-orders branch from 70b6057 to 2c0ab48 Compare October 1, 2026 10:33
@abretonc7s
abretonc7s force-pushed the feat/lighter-position-protection-guards branch from a3da678 to 4570b16 Compare October 1, 2026 10:33

@geositta geositta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes because a rejected Lighter removal can resume through background recovery and cancel the remaining protection after the position changes. The new dispatch guard stops the foreground cancellation, but that decision must also constrain the durable journal. Please retain reconciliation of already dispatched attempts without allowing recovery to issue the rejected cancellation.

Comment thread packages/perps-controller/src/providers/LighterProvider.ts
@abretonc7s
abretonc7s requested a review from geositta October 2, 2026 06:35
@abretonc7s
abretonc7s merged commit 5ca7c85 into feat/lighter-native-trigger-orders Oct 2, 2026
45 checks passed
@abretonc7s
abretonc7s deleted the feat/lighter-position-protection-guards branch October 2, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants