You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
@metamask/perps-controller 16.1.0
Fixed
Revalidate HyperLiquid positions over HTTP before reporting a WebSocket cache miss during a TP/SL update. (#10101)
A current DEX slice is stamped with the connection epoch, which proves it belongs to the live subscription but not that it has caught up with the most recent fill. updatePositionTPSL therefore treated the post-fill window, where the position exists on the venue but has not yet been published, as identical to a position that was closed, and returned POSITION_NOT_FOUND without making a request.
Only updatePositionTPSL opts in. closePosition, closePositions and the margin operations keep failing closed on a cache miss, because they act on a position the user is looking at: an unpublished position is not rendered, so those flows cannot reach the post-fill window. TP/SL attachment is the one path a client fires automatically within milliseconds of placing an order, with no human in the loop. Keeping the opt-in narrow also keeps the added REST traffic off the batch paths.
A cache hit still returns the WebSocket slice untouched, so a stale size on a symbol that is present is resolved exactly as before, and the reduce-only sizing guarantees added in #10037 are unaffected.