Skip to content

1228.0.0

Choose a tag to compare

@github-actions github-actions released this 02 Sep 07:22
482df43

@metamask/perps-controller 15.1.0

Added

  • Add provider-routed Scale price normalization through PerpsController:getScalePriceLadder, the optional PerpsProvider.getScalePriceLadder hook, and their exported action, parameter, and result types. DirectProviderScalePriceLadderUnavailableReason and ScalePriceLadderUnavailableReason limit unavailable results to direct-provider and routed failures respectively (#10021, #10065)
  • Add an optional batch-level error to ClosePositionsResult for an operation-level close failure, including cases that also populate per-position results (#10037)
  • Add PerpsController.subscribeToTwapOrders and the optional PerpsProvider.subscribeToTwapOrders hook for streaming TWAP updates, implemented for HyperLiquid (#10056)

Fixed

  • Prevent stale HyperLiquid positions from driving TP/SL, close, batch-close, margin-update, and HIP-3 margin calculations (#10037)
    • Symbol operations use the current DEX slice or an HTTP read. Batch operations require a complete current WebSocket or REST snapshot. Partial reads fail with PROVIDER_NOT_AVAILABLE; REST and WebSocket data are never merged.
    • Selected-symbol closePositions loads only the market groups those symbols belong to. A complete all-DEX snapshot is required only for closeAll or an empty symbols list. A PROVIDER_NOT_AVAILABLE failure on one requested DEX does not abort closes on the others; those symbols are reported as per-position failures.
    • A delayed clearinghouseState payload from a replaced subscription client is ignored so it cannot stamp stale size or side with the new connection epoch.
  • Floor TP/SL and reduce-only edit sizes to the venue size grid instead of rounding above the position (#10037)
    • Sub-increment sizes fail before side effects with ORDER_TPSL_SIZE_INVALID or ORDER_SIZE_POSITIVE.