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.2.0
Added
Add ORDER_MARGIN_MODE_INVALID, ORDER_MARGIN_MODE_UNSUPPORTED, ORDER_MARGIN_MODE_POSITION_OPEN, and ORDER_MARGIN_MODE_ORDER_OPEN to the exported PerpsErrorCode union. (#10136)
Expanding PerpsErrorCode is a minor. Clients should handle unknown codes in a catch-all rather than an exhaustive Record<PerpsErrorCode, …>. Existing callers that omit marginMode keep the same runtime behavior.
Add explicit HyperLiquid OrderParams.marginMode selection with market-capability and open-position/order/TWAP guards, and expose the venue's MarketInfo.marginMode capability. (#10136)
Fixed
Keep the terminal HyperLiquid TWAP record when a completing fill ties lastUpdated with the activation, so a finished schedule is no longer reported as live. (#10122)
The venue reports one lifecycle as several twapHistory entries, an activation plus a terminal record, and slice fills are looked up by twapId so every entry of a schedule receives the same fills. entry.time is a whole-second value, so when the final fill is what completed the schedule its millisecond timestamp outranks both entries' own timestamps and both derive an identical lastUpdated.
Collapsing entries with >= admitted that tie. The venue returns the terminal record first, so the activation was iterated last and overwrote it, resolveTwapOrderStatus mapped activated to Active, and the schedule stayed listed as live carrying the activation's zero executed size while offering a cancel the venue can no longer act on. Schedules that were terminated stop seconds after their last fill, never tie, and were unaffected.
Terminality is now decided before timestamps, and lastUpdated is compared strictly so an equal value keeps the record already collapsed. Termination is still only ever taken from venue status and never inferred from elapsed time, so collateral cannot be reclaimed from a live TWAP. Both the polled read and the subscription adapter are corrected.
Handle zero minimum order amounts and margin fractions reported by Lighter for inactive markets by omitting unusable retired rows, while keeping valid delisted metadata and active market values strict. (#10110)
Resolve Lighter accounts from sparse address-discovery rows and every API-key slot, settle confirmed missing accounts to an empty state, and preserve the last authoritative state across transport, authentication, and malformed-response failures. (#10119)
Accept Lighter trade rows that omit the counterparty's realized PnL while continuing to require a valid PnL for the selected account. (#10119)
Stop emitting a debug log for every Lighter price-stream frame. (#10119)