@metamask-previews/perps-controller 24.0.0-preview-bf9d42292 → 24.1.0-preview-8647f16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +38 -1
  2. package/dist/constants/perpsConfig.d.ts +9 -4
  3. package/dist/constants/perpsConfig.d.ts.map +1 -1
  4. package/dist/constants/perpsConfig.js +17 -4
  5. package/dist/constants/perpsConfig.js.map +1 -1
  6. package/dist/index.d.ts +6 -6
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +3 -3
  9. package/dist/index.js.map +1 -1
  10. package/dist/providers/HyperLiquidProvider.d.ts.map +1 -1
  11. package/dist/providers/HyperLiquidProvider.js +9 -2
  12. package/dist/providers/HyperLiquidProvider.js.map +1 -1
  13. package/dist/services/HyperLiquidSubscriptionService.d.ts.map +1 -1
  14. package/dist/services/HyperLiquidSubscriptionService.js +21 -9
  15. package/dist/services/HyperLiquidSubscriptionService.js.map +1 -1
  16. package/dist/types/index.d.ts +16 -1
  17. package/dist/types/index.d.ts.map +1 -1
  18. package/dist/types/index.js.map +1 -1
  19. package/dist/utils/accountUtils.d.ts +36 -5
  20. package/dist/utils/accountUtils.d.ts.map +1 -1
  21. package/dist/utils/accountUtils.js +99 -15
  22. package/dist/utils/accountUtils.js.map +1 -1
  23. package/dist/utils/index.d.ts +2 -0
  24. package/dist/utils/index.d.ts.map +1 -1
  25. package/dist/utils/index.js +1 -0
  26. package/dist/utils/index.js.map +1 -1
  27. package/dist/utils/lighterAdapter.d.ts.map +1 -1
  28. package/dist/utils/lighterAdapter.js +8 -0
  29. package/dist/utils/lighterAdapter.js.map +1 -1
  30. package/dist/utils/marginAdjustment.d.ts +68 -0
  31. package/dist/utils/marginAdjustment.d.ts.map +1 -0
  32. package/dist/utils/marginAdjustment.js +83 -0
  33. package/dist/utils/marginAdjustment.js.map +1 -0
  34. package/dist/utils/perpsFormatters.d.ts +101 -4
  35. package/dist/utils/perpsFormatters.d.ts.map +1 -1
  36. package/dist/utils/perpsFormatters.js +216 -3
  37. package/dist/utils/perpsFormatters.js.map +1 -1
  38. package/dist/utils/tpslCalculations.d.ts +25 -0
  39. package/dist/utils/tpslCalculations.d.ts.map +1 -1
  40. package/dist/utils/tpslCalculations.js +15 -0
  41. package/dist/utils/tpslCalculations.js.map +1 -1
  42. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,8 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [24.1.0]
11
+
10
12
  ### Added
11
13
 
14
+ - Add `AccountState.spotCollateral`, the spot USDC that counts as cross collateral, so clients can pass it to `calculateAccountSummary` instead of assuming spot collateral is `0` ([#11457](https://github.com/MetaMask/core/pull/11457))
15
+ - The value is a canonical USDC decimal string. It is absent while the spot state or the Hyperliquid abstraction mode is still unknown, and `calculateAccountSummary` then leaves `accountRatio` and `crossMarginUsage` undefined
16
+ - Hyperliquid Standard (`disabled` and `default`) reports `'0'`: spot is a separate ledger and is not collateral
17
+ - Hyperliquid Unified and portfolio margin report free spot USDC, `max(0, spot.total - spot.hold)`, counting USDC only. A USDC balance with a missing or non-finite `total` or `hold`, or a response whose `balances` is not a list, leaves the field absent instead of counting the bad amount as `0`. A response that lists no USDC balance is a genuine `'0'`
18
+ - The live account stream republishes when a previously unknown abstraction mode resolves to Standard (`disabled` or `default`). Unknown and Standard both keep spot out of spendable balance, so the stream compares the published `spotCollateral` and pushes `'0'` without waiting for the next balance tick
19
+ - A known Lighter account reports `'0'`. That venue has no separate spot ledger; its collateral is already in the account value. A failed Lighter read still omits the field
20
+ - Add `getCrossMarginSpotCollateral(spotState, abstractionMode)`, the same free-spot USDC calculation published as `AccountState.spotCollateral` ([#11457](https://github.com/MetaMask/core/pull/11457))
21
+ - Returns `undefined` while the spot state or the abstraction mode is unknown, `'0'` for Standard (`disabled` and `default`), and free spot USDC for Unified and portfolio margin
22
+ - Export the `HyperLiquidAbstractionMode` type (`unifiedAccount`, `portfolioMargin`, `disabled`, `default`), the mode argument of `getCrossMarginSpotCollateral` ([#11457](https://github.com/MetaMask/core/pull/11457))
12
23
  - Add `PerpsController.getProviderHealth(providerId)` and `PerpsController.subscribeToProviderHealth({ providerId, callback })` (messenger actions `PerpsController:getProviderHealth` and `PerpsController:subscribeToProviderHealth`) to report each provider's health separately, including in aggregated mode ([#11502](https://github.com/MetaMask/core/pull/11502))
13
24
  - New types `PerpsProviderHealth`, `PerpsProviderHealthReason` and `SubscribeProviderHealthParams`, and messenger action types `PerpsControllerGetProviderHealthAction` and `PerpsControllerSubscribeToProviderHealthAction`
14
25
  - Status is `healthy`, `degraded` (with `reasons`: `socket_down`, `server_errors`, `rate_limited`) or `unavailable` when the provider is not registered, or is disconnected with no reconnect pending. It describes the provider, not its socket: Lighter still reports `healthy` after closing its socket because nothing listens
@@ -20,10 +31,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
20
31
  - `@metamask/perps-controller/constants` and `@metamask/perps-controller/constants/lighterConfig`: `LIGHTER_REST_REQUESTS_PER_MINUTE`, `LIGHTER_REST_BUDGET_WINDOW_MS`, `LIGHTER_RATE_LIMIT_BASE_COOLDOWN_MS`, `LIGHTER_RATE_LIMIT_MAX_COOLDOWN_MS`, `LIGHTER_SERVER_ERROR_DEGRADED_THRESHOLD`, `LIGHTER_CHANNEL_RELEASE_DELAY_MS`, `LIGHTER_SOCKET_IDLE_CLOSE_MS`, `LIGHTER_RECONNECT_BASE_DELAY_MS`, `LIGHTER_RECONNECT_MAX_DELAY_MS` and `LIGHTER_SOCKET_DOWN_GRACE_MS`
21
32
  - `@metamask/perps-controller/utils/providerHealth`: `getHealthFromConnectionState`, `getProviderHealthOf`, `subscribeToProviderHealthOf` and the `ProviderHealthSource` type
22
33
  - `@metamask/perps-controller/providers/lighter`: `getLighterReconnectDelayMs`
34
+ - Add funding display formatters, so Mobile, Extension and Terminal stop formatting funding locally. Each formatter takes the same `formatters` and `sign` (default `exceptZero`) options as the other display formatters and renders `$---` for a missing value ([#11529](https://github.com/MetaMask/core/pull/11529))
35
+ - `formatPositionFunding(sinceOpen, options)` formats funding since a position opened, with the venue's sign (positive = paid), as Mobile and Extension show it: `formatPositionFunding('1.2345')` returns `-$1.23`, `formatPositionFunding(-1234.5)` returns `+$1,234.50`, and under half a cent `formatPositionFunding(0.0049)` returns `$0.00`
36
+ - `getPositionFundingDirection(sinceOpen)` returns `cost`, `payment` or `none` with the same half-cent threshold, for colouring: `getPositionFundingDirection(0.005)` returns `cost`
37
+ - `formatFundingPayment(amount, options)` formats one funding payment with the trader's sign (positive = received). From a cent up it matches Mobile: `formatFundingPayment(-12.5)` returns `-$12.50`. Below a cent it keeps up to 6 fraction digits, never in exponent notation: `formatFundingPayment(0.003421)` returns `+$0.003421`, and `formatFundingPayment(0.0000004)` returns `$0.00`
38
+ - Type `PerpsFundingDirection`
39
+ - Add `PERPS_DISPLAY_PRECISION` values for Terminal's depth chart and TWAP summary: `OrderBookDepthRangePercent` 4, `OrderBookDepthZoomRangePercentMax` 5 and `TwapSuborderSize` 5 ([#11529](https://github.com/MetaMask/core/pull/11529))
40
+ - Add `source: 'pasted'` to `formatPerpsUsdInput` for clipboard text, whose decimal point may be `.` in any locale: `formatPerpsUsdInput('1234.56', { formatters: createFormatters({ locale: 'es' }), source: 'pasted' })` returns `{ value: '1234.56', display: '1234,56' }`, where typed text reads `123456` ([#11529](https://github.com/MetaMask/core/pull/11529))
41
+ - Separators still group thousands when 1-3 digits are followed by groups of exactly 3: `1.234.567` and `12.345` stay 1234567 and 12345. Uneven groups keep the last separator as the decimal point: `1.234.5` reads 1234.5
42
+ - Where the locale's decimal is `.`, pasted text reads as typed
43
+ - Add margin adjustment calculations for an isolated position, following Mobile's margin utilities, so Mobile and Terminal stop keeping their own copies ([#11529](https://github.com/MetaMask/core/pull/11529))
44
+ - `calculateMaxRemovableMargin(params)` returns the margin that can be removed: the margin above `max(notional / positionLeverage, notional × MARGIN_ADJUSTMENT_CONFIG.MarginRemovalSafetyBuffer)`, less a price-move headroom (`priceMoveBufferRatio`). `calculateMaxRemovableMargin({ currentMargin: 3000, positionLeverage: 50, positionSize: 10, currentPrice: 2000 })` returns `800`
45
+ - `estimateLiquidationPriceAfterMarginChange(params)` estimates the liquidation price after adding or removing margin, anchored on the venue's current one. Adding $1,000 to a 0.5 BTC long liquidating at 80,000 with max leverage 20 returns about `77948.72`
46
+ - `MARGIN_ADJUSTMENT_CONFIG.MarginRemovalPriceMoveBuffer` (0.01), the default headroom
47
+ - Types `MaxRemovableMarginParams` and `LiquidationPriceAfterMarginChangeParams`
48
+ - Add `calculateExpectedTriggerPnl({ triggerPrice, entryPrice, size, closingFee })`, the expected PnL when a take profit or stop loss closes a position, net of the closing fee, as Mobile's TP/SL form shows it: `calculateExpectedTriggerPnl({ triggerPrice: 110, entryPrice: 100, size: 2, closingFee: 0.1 })` returns `19.9`. Type `ExpectedTriggerPnlParams` ([#11529](https://github.com/MetaMask/core/pull/11529))
49
+ - Add `formatCrossMarginRatio` so Mobile and Extension can render a 0..1 cross margin ratio as an unsigned percentage with at most one decimal ([#11456](https://github.com/MetaMask/core/pull/11456))
50
+ - `formatCrossMarginRatio(0.174)` returns `17.4%`, `formatCrossMarginRatio(0.63)` returns `63%` and `formatCrossMarginRatio(0)` returns `0%`. A negative ratio keeps its minus: `formatCrossMarginRatio(-0.174)` returns `-17.4%`. A missing ratio returns `--%`
51
+ - Pass `createFormatters({ locale })` as `formatters` and the locale's percent style renders the value, so separators, rounding and the `%` placement follow the locale: `formatCrossMarginRatio(0.174, { formatters: createFormatters({ locale: 'de' }) })` returns `17,4 %` (no-break space) and Turkish returns `%17,4`. The ratio is passed to the formatter as is, so decimal ties round as `Intl` percent formatting does (`0.0255` returns `2.6%`, `-0.0255` returns `-2.6%`). A ratio that rounds to zero is `0%`, never `-0%`. The minus sign is the shared `-`, the same prefix as the other display formatters
52
+ - This is the percent-style formatter. `formatPercentage`, `formatFundingRate` and `formatLiquidationDistance` still append a bare `%` after a fixed-decimal number, so in `de` this returns `17,4 %` while `formatPercentage(17.4, { decimals: 1, sign: 'never' })` returns `17,4%`. A follow-up should move those three onto the same percent style
53
+ - `PERPS_DISPLAY_PRECISION.CrossMarginRatioPercent` is 1, the most decimals shown
23
54
 
24
55
  ### Changed
25
56
 
26
57
  - Bump `@metamask/utils` from `^12.0.1` to `^12.0.2` ([#11474](https://github.com/MetaMask/core/pull/11474))
58
+ - Bump `@metamask/authenticated-user-storage` from `^4.1.0` to `^4.2.0` ([#11488](https://github.com/MetaMask/core/pull/11488))
59
+ - Bump `@metamask/keyring-controller` from `^28.2.0` to `^28.2.2` ([#11474](https://github.com/MetaMask/core/pull/11474), [#11537](https://github.com/MetaMask/core/pull/11537))
60
+ - Bump `@metamask/profile-sync-controller` from `^36.1.1` to `^36.1.2` ([#11474](https://github.com/MetaMask/core/pull/11474))
61
+ - Bump `@metamask/subscription-controller` from `^15.2.1` to `^15.2.2` ([#11472](https://github.com/MetaMask/core/pull/11472))
62
+ - Bump `@metamask/transaction-controller` from `^73.1.2` to `^74.0.0` ([#11472](https://github.com/MetaMask/core/pull/11472))
27
63
  - Lighter releases a stream channel 5 seconds after its last listener leaves: it sends `unsubscribe`, drops the channel from the reconnect set and drops its cached order book, candle series or price snapshot ([#11502](https://github.com/MetaMask/core/pull/11502))
28
64
  - Applies to `order_book`, `candle`, `trade` and `market_stats` channels; account channels are released as a group once no account, position, order or fill listener is left
29
65
  - A listener that returns within the wait keeps the channel without new frames
@@ -1550,7 +1586,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1550
1586
 
1551
1587
  - Bump `@metamask/controller-utils` from `^11.18.0` to `^11.19.0` ([#7995](https://github.com/MetaMask/core/pull/7995))
1552
1588
 
1553
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@24.0.0...HEAD
1589
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@24.1.0...HEAD
1590
+ [24.1.0]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@24.0.0...@metamask/perps-controller@24.1.0
1554
1591
  [24.0.0]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@23.1.0...@metamask/perps-controller@24.0.0
1555
1592
  [23.1.0]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@23.0.0...@metamask/perps-controller@23.1.0
1556
1593
  [23.0.0]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@22.3.0...@metamask/perps-controller@23.0.0
@@ -232,6 +232,7 @@ export declare const MARGIN_ADJUSTMENT_CONFIG: {
232
232
  readonly MinAdjustmentAmount: 1;
233
233
  readonly CalculationPrecision: 6;
234
234
  readonly MarginRemovalSafetyBuffer: 0.1;
235
+ readonly MarginRemovalPriceMoveBuffer: 0.01;
235
236
  readonly FallbackMaxLeverage: 50;
236
237
  };
237
238
  /**
@@ -510,13 +511,14 @@ export declare const FUNDING_RATE_CONFIG: {
510
511
  /**
511
512
  * Decimal places shown for each displayed perps value, shared by Mobile,
512
513
  * Extension and Terminal. Pass one as the `decimals` option of the display
513
- * formatters (`formatPercentage`, `formatPnl`, `formatPerpsFiat`,
514
- * `formatFundingRate`, `formatFeeBps`, `formatLiquidationDistance`,
515
- * `formatPerpsCompact`, `formatPerpsUsdInput`). Prices follow
516
- * `PRICE_RANGES_UNIVERSAL` instead.
514
+ * formatters (`formatPercentage`, `formatCrossMarginRatio`, `formatPnl`,
515
+ * `formatPerpsFiat`, `formatFundingRate`, `formatFeeBps`,
516
+ * `formatLiquidationDistance`, `formatPerpsCompact`,
517
+ * `formatPerpsUsdInput`). Prices follow `PRICE_RANGES_UNIVERSAL` instead.
517
518
  */
518
519
  export declare const PERPS_DISPLAY_PRECISION: {
519
520
  readonly Percentage: 2;
521
+ readonly CrossMarginRatioPercent: 1;
520
522
  readonly RoePercent: 1;
521
523
  readonly Pnl: 2;
522
524
  readonly Fee: 2;
@@ -533,6 +535,9 @@ export declare const PERPS_DISPLAY_PRECISION: {
533
535
  readonly VolumeCompactThousands: 0;
534
536
  readonly OrderBookCompact: 1;
535
537
  readonly OrderBookAbbreviatedPriceMax: 3;
538
+ readonly OrderBookDepthRangePercent: 4;
539
+ readonly OrderBookDepthZoomRangePercentMax: 5;
540
+ readonly TwapSuborderSize: 5;
536
541
  };
537
542
  /**
538
543
  * Provider configuration for multi-provider support
@@ -1 +1 @@
1
- {"version":3,"file":"perpsConfig.d.ts","sourceRoot":"","sources":["../../src/constants/perpsConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,+CAA+C,CAAC;AACzE,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,eAAO,MAAM,eAAe;aAC1B,cAAc,EAAE,cAAc;aAC9B,WAAW,EAAE,OAAO;IACpB,sGAAsG;aACtG,4BAA4B,EAAE,eAAe;IAC7C,uFAAuF;aACvF,uBAAuB,EAAE,KAAK;aAC9B,gBAAgB,EAAE,IAAI;aACtB,qBAAqB,EAAE,IAAI;aAC3B,yBAAyB,EAAE,KAAM;aACjC,mBAAmB,EAAE,KAAM;aAC3B,0BAA0B,EAAE,KAAM;aAGlC,uBAAuB,EAAE,KAAM;aAC/B,0BAA0B,EAAE,KAAM;aAClC,sBAAsB,EAAE,IAAK;aAC7B,mBAAmB,EAAE,GAAG;aACxB,0BAA0B,EAAE,GAAG;aAC/B,0BAA0B,EAAE,GAAG;aAC/B,0BAA0B,EAAE,GAAG;aAC/B,sBAAsB,EAAE,GAAG;aAC3B,wBAAwB,EAAE,IAAK;aAC/B,wBAAwB,EAAE,CAAC;aAC3B,yBAAyB,EAAE,IAAK;aAGhC,uBAAuB,EAAE,KAAK;aAC9B,kBAAkB,EAAE,GAAG;aAGvB,mBAAmB,EAAE,KAAM;aAG3B,+BAA+B,EAAE,KAAM;aAEvC,wBAAwB,EAAE,CAAC;aAC3B,kBAAkB,EAAO,MAAM;aAC/B,oBAAoB,EAAE,MAA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uB,EAAE,CAAC;aAE1B,UAAU,EAAE,CAAC;aAEb,GAAG,EAAE,CAAC;aAEN,GAAG,EAAE,CAAC;aAEN,cAAc,EAAE,CAAC;aAEjB,kBAAkB;aAElB,uBAAuB,EAAE,CAAC;aAE1B,gBAAgB;aAEhB,MAAM,EAAE,CAAC;aAET,0BAA0B,EAAE,CAAC;aAE7B,mBAAmB,EAAE,CAAC;aAEtB,QAAQ,EAAE,CAAC;aAEX,iBAAiB,EAAE,CAAC;aAEpB,aAAa,EAAE,CAAC;aAEhB,sBAAsB,EAAE,CAAC;aAEzB,gBAAgB,EAAE,CAAC;aAEnB,4BAA4B,EAAE,CAAC;aAG/B,0BAA0B,EAAE,CAAC;aAE7B,iCAAiC,EAAE,CAAC;aAEpC,gBAAgB,EAAE,CAAC;CACX,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B,uEAAuE;aACvE,eAAe,EAAE,aAAa;IAC9B;;;;;;OAMG;aACH,oBAAoB;CACZ,CAAC;AAQX,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AACnE,eAAO,MAAM,0BAA0B,kCAAkC,CAAC;AAC1E,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,QAAS,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,MAAM,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,OAAO,GACjB,MAAM,CAMR"}
@@ -333,6 +333,10 @@ export const MARGIN_ADJUSTMENT_CONFIG = {
333
333
  // HyperLiquid enforces: transfer_margin_required = max(initial_margin_required, 0.1 * total_position_value)
334
334
  // See: https://hyperliquid.gitbook.io/hyperliquid-docs/trading/margin-and-pnl
335
335
  MarginRemovalSafetyBuffer: 0.1,
336
+ // Share of notional kept back from a margin removal for the mark price
337
+ // moving before the venue processes it; the exact boundary is rejected on
338
+ // any adverse tick
339
+ MarginRemovalPriceMoveBuffer: 0.01,
336
340
  // Fallback max leverage when market data is unavailable
337
341
  // Conservative value to prevent over-removal of margin
338
342
  // Most HyperLiquid assets support at least 50x leverage
@@ -570,14 +574,16 @@ export const FUNDING_RATE_CONFIG = {
570
574
  /**
571
575
  * Decimal places shown for each displayed perps value, shared by Mobile,
572
576
  * Extension and Terminal. Pass one as the `decimals` option of the display
573
- * formatters (`formatPercentage`, `formatPnl`, `formatPerpsFiat`,
574
- * `formatFundingRate`, `formatFeeBps`, `formatLiquidationDistance`,
575
- * `formatPerpsCompact`, `formatPerpsUsdInput`). Prices follow
576
- * `PRICE_RANGES_UNIVERSAL` instead.
577
+ * formatters (`formatPercentage`, `formatCrossMarginRatio`, `formatPnl`,
578
+ * `formatPerpsFiat`, `formatFundingRate`, `formatFeeBps`,
579
+ * `formatLiquidationDistance`, `formatPerpsCompact`,
580
+ * `formatPerpsUsdInput`). Prices follow `PRICE_RANGES_UNIVERSAL` instead.
577
581
  */
578
582
  export const PERPS_DISPLAY_PRECISION = {
579
583
  // Generic percentage, such as the 24h change: "+5.25%"
580
584
  Percentage: 2,
585
+ // Cross margin account ratio and usage, from a 0..1 ratio: "17.4%", "63%"
586
+ CrossMarginRatioPercent: 1,
581
587
  // Return on equity: "+10.3%"
582
588
  RoePercent: 1,
583
589
  // Profit and loss in USD: "+$12.34"
@@ -610,6 +616,13 @@ export const PERPS_DISPLAY_PRECISION = {
610
616
  OrderBookCompact: 1,
611
617
  // Most decimals of an abbreviated order book price: "$61.47K"
612
618
  OrderBookAbbreviatedPriceMax: 3,
619
+ // Distance of an order book depth level from the mid price as a
620
+ // percentage: "+0.0125%"
621
+ OrderBookDepthRangePercent: 4,
622
+ // Most decimals of the depth chart zoom range as a percentage: "0.00125"
623
+ OrderBookDepthZoomRangePercentMax: 5,
624
+ // Most decimals of a TWAP sub-order's base-asset size: "0.00012"
625
+ TwapSuborderSize: 5,
613
626
  };
614
627
  /**
615
628
  * Provider configuration for multi-provider support
@@ -1 +1 @@
1
- {"version":3,"file":"perpsConfig.js","sourceRoot":"","sources":["../../src/constants/perpsConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,4CAA4C,CAAC;AACzE,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;AAElC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,cAAc,EAAE,cAAc;IAC9B,WAAW,EAAE,OAAO,EAAE,kFAAkF;IACxG,sGAAsG;IACtG,4BAA4B,EAAE,eAAe;IAC7C,uFAAuF;IACvF,uBAAuB,EAAE,KAAK;IAC9B,gBAAgB,EAAE,IAAI,EAAE,YAAY;IACpC,qBAAqB,EAAE,IAAI,EAAE,WAAW;IACxC,yBAAyB,EAAE,MAAM,EAAE,6FAA6F;IAChI,mBAAmB,EAAE,MAAM,EAAE,gEAAgE;IAC7F,0BAA0B,EAAE,MAAM,EAAE,4DAA4D;IAEhG,8BAA8B;IAC9B,uBAAuB,EAAE,MAAM,EAAE,+GAA+G;IAChJ,0BAA0B,EAAE,MAAM,EAAE,2EAA2E;IAC/G,sBAAsB,EAAE,KAAK,EAAE,oDAAoD;IACnF,mBAAmB,EAAE,GAAG,EAAE,kEAAkE;IAC5F,0BAA0B,EAAE,GAAG,EAAE,2GAA2G;IAC5I,0BAA0B,EAAE,GAAG,EAAE,uDAAuD;IACxF,0BAA0B,EAAE,GAAG,EAAE,+EAA+E;IAChH,sBAAsB,EAAE,GAAG,EAAE,0DAA0D;IACvF,wBAAwB,EAAE,KAAK,EAAE,gDAAgD;IACjF,wBAAwB,EAAE,CAAC,EAAE,kEAAkE;IAC/F,yBAAyB,EAAE,KAAK,EAAE,iFAAiF;IAEnH,sCAAsC;IACtC,uBAAuB,EAAE,KAAK,EAAE,oFAA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G;AACH,MAAM,UAAU,qBAAqB,CAAC,KAGrC;IACC,OAAO,GAAG,KAAK,CAAC,cAAc,IAAI,eAAe,CAAC,eAAe,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AACjH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,UAAkB,EAClB,SAAkB;IAElB,IAAI,gBAAgB,GAAG,SAAS,CAAC;IACjC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,gBAAgB,GAAG,eAAe,CAAC,oBAAoB,IAAI,SAAS,CAAC;IACvE,CAAC;IACD,OAAO,GAAG,UAAU,IAAI,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AACrE,CAAC","sourcesContent":["/**\n * Perps feature constants - Controller layer (portable)\n *\n * This file contains only controller-portable configuration:\n * - Constants used by controller logic, providers, and services\n * - Calculation thresholds, API configs, and protocol constants\n *\n * UI-only constants (layout, display, navigation) live in:\n * app/components/UI/Perps/constants/perpsConfig.ts\n */\nexport const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';\nexport const ZERO_BALANCE = '0x0';\n\nexport const PERPS_CONSTANTS = {\n FeatureFlagKey: 'perpsEnabled',\n FeatureName: 'perps', // Constant for Sentry error filtering - enables \"feature:perps\" dashboard queries\n /** Token description used to identify the synthetic \"Perps balance\" option in pay-with token lists */\n PerpsBalanceTokenDescription: 'perps-balance',\n /** Symbol displayed for the synthetic \"Perps balance\" token in pay-with token lists */\n PerpsBalanceTokenSymbol: 'USD',\n WebsocketTimeout: 5000, // 5 seconds\n WebsocketCleanupDelay: 1000, // 1 second\n BackgroundDisconnectDelay: 20_000, // 20 seconds delay before disconnecting when app is backgrounded or when user exits perps UX\n ConnectionTimeoutMs: 10_000, // 10 seconds timeout for connection and position loading states\n DefaultMonitoringTimeoutMs: 10_000, // 10 seconds default timeout for data monitoring operations\n\n // Connection timing constants\n ConnectionGracePeriodMs: 20_000, // 20 seconds grace period before actual disconnection (same as BackgroundDisconnectDelay for semantic clarity)\n ConnectionAttemptTimeoutMs: 30_000, // 30 seconds timeout for connection attempts to prevent indefinite hanging\n WebsocketPingTimeoutMs: 5_000, // 5 seconds timeout for WebSocket health check ping\n ConnectRetryDelayMs: 200, // Delay before retrying connect() when connection isn't ready yet\n ForegroundPingRetryDelayMs: 500, // Delay before retrying ping in resumeFromForeground — JS thread may be sluggish right after foregrounding\n ReconnectionCleanupDelayMs: 500, // Platform-agnostic delay to ensure WebSocket is ready\n ReconnectionDelayAndroidMs: 300, // Android-specific reconnection delay for better reliability on slower devices\n ReconnectionDelayIosMs: 100, // iOS-specific reconnection delay for optimal performance\n ReconnectionRetryDelayMs: 5_000, // 5 seconds delay between reconnection attempts\n NetworkRestoreMaxRetries: 8, // Max retry attempts when reconnecting after WiFi/network restore\n NetworkRestoreRetryBaseMs: 1_500, // Base delay (ms) between network restore retries (multiplied by attempt number)\n\n // Connection manager timing constants\n BalanceUpdateThrottleMs: 15000, // Update at most every 15 seconds to reduce state updates in PerpsConnectionManager\n InitialDataDelayMs: 100, // Delay to allow initial data to load after connection establishment\n\n // Order submission timing\n PlaceOrderTimeoutMs: 60_000, // Hard timeout for provider round-trip in TradingService.placeOrder\n\n // Deposit toast timing\n DepositTakingLongerToastDelayMs: 30_000, // Delay before showing \"Deposit taking longer than usual\" toast\n\n DefaultAssetPreviewLimit: 5,\n DefaultMaxLeverage: 3 as number, // Default fallback max leverage when market data is unavailable - conservative default\n FallbackPriceDisplay: '$---', // Display when price data is unavailable\n FallbackPercentageDisplay: '--%', // Display when change data is unavailable\n FallbackDataDisplay: '--', // Display when non-price data is unavailable\n ZeroAmountDisplay: '$0', // Display for zero dollar amounts (e.g., no volume)\n ZeroAmountDetailedDisplay: '$0.00', // Display for zero dollar amounts with decimals\n\n RecentActivityLimit: 3,\n\n // Historical data fetching constants\n FillsLookbackMs: 90 * 24 * 60 * 60 * 1000, // 3 months in milliseconds - limits REST API fills fetch\n\n // Recently viewed markets\n RecentlyViewedMarketsTtlMs: 24 * 60 * 60 * 1000, // 24 hours TTL for recently viewed market entries\n RecentlyViewedMarketsLimit: 10, // Maximum number of recently viewed markets to track\n\n // Temporary order form draft\n PendingTradeConfigurationTtlMs: 30_000, // Restore a draft only during a brief navigation away from the form\n} as const;\n\n/**\n * Withdrawal-specific constants (protocol-agnostic)\n * Note: Protocol-specific values like estimated time should be defined in each protocol's config\n */\nexport const WITHDRAWAL_CONSTANTS = {\n DefaultMinAmount: '1.01', // Default minimum withdrawal amount in USDC\n DefaultFeeAmount: 1, // Default withdrawal fee in USDC\n DefaultFeeToken: 'USDC', // Default fee token\n} as const;\n\n/**\n * Validation thresholds for UI warnings and checks\n * These values control when warnings are shown to users\n */\nexport const VALIDATION_THRESHOLDS = {\n // Leverage threshold for warning users about high leverage\n HighLeverageWarning: 20, // Show warning when leverage > 20x\n\n // Limit price difference threshold (as decimal, 0.1 = 10%)\n LimitPriceDifferenceWarning: 0.1, // Warn if limit price differs by >10% from current price\n\n // Price deviation threshold (as decimal, 0.1 = 10%)\n PriceDeviation: 0.1, // Warn if perps price deviates by >10% from spot price\n} as const;\n\n/**\n * Order slippage configuration\n * Controls default slippage tolerance for different order types\n * Conservative defaults based on HyperLiquid platform interface\n * See: docs/perps/hyperliquid/ORDER-MATCHING-ERRORS.md\n */\nexport const ORDER_SLIPPAGE_CONFIG = {\n // Market order slippage (basis points)\n // 300 basis points = 3% = 0.03 decimal\n // Conservative default for measured rollout, prevents most IOC failures\n DefaultMarketSlippageBps: 300,\n\n // TP/SL order slippage (basis points)\n // 1000 basis points = 10% = 0.10 decimal\n // Aligns with HyperLiquid platform default for triggered orders\n DefaultTpslSlippageBps: 1000,\n\n // Limit order slippage (basis points)\n // 100 basis points = 1% = 0.01 decimal\n // Kept conservative as limit orders rest on book (not IOC/immediate execution)\n DefaultLimitSlippageBps: 100,\n} as const;\n\n/**\n * Defaults and bounds for the emulated `chase` placement.\n *\n * No supported venue exposes a chase as an API action — HyperLiquid documents it\n * as running client-side — so the strategy is run here: a post-only order rests\n * one tick inside the spread and is cancelled and re-placed as the touch moves.\n * The poll floor limits request frequency; callers may also set explicit\n * duration or repricing caps. Protocol-agnostic — a provider that gains a\n * native chase ignores these entirely.\n */\nexport const CHASE_ORDER_CONFIG = {\n /** Maximum submissions used to survive a touch moving before an ALO rests. */\n InitialPlacementAttempts: 3,\n /** How often the touch is re-read when the caller does not say. */\n DefaultIntervalMs: 15000,\n /** Floor on the poll interval, whatever the caller asks for. */\n MinIntervalMs: 1000,\n /**\n * How many chases may run at once.\n *\n * HyperLiquid documents a cap of five simultaneously active chase orders. It\n * is a venue rule rather than controller policy, but it is spelled here\n * alongside the rest of the chase configuration because an emulated chase is\n * the only thing that can enforce it.\n */\n MaxActiveSessions: 5,\n} as const;\n\n/** Public lifecycle states reported for an emulated Chase order. */\nexport const CHASE_ORDER_STATUS = {\n Active: 'active',\n TerminationPending: 'termination_pending',\n Backgrounded: 'backgrounded',\n MaxDistanceReached: 'max_distance_reached',\n DurationReached: 'duration_reached',\n RepricingLimitReached: 'repricing_limit_reached',\n Filled: 'filled',\n Canceled: 'canceled',\n Failed: 'failed',\n} as const;\n\n/**\n * Bounds and step for the user-configurable max slippage preference (basis points).\n * Shared by the controller (`setMaxSlippage`) and UI (`slippageConfig.ts`).\n */\nexport const MAX_SLIPPAGE_BOUNDS = {\n MinBps: 10,\n MaxBps: 1000,\n StepBps: 10,\n} as const;\n\n/**\n * Max order amount buffer to reduce \"Insufficient margin\" rejections from the exchange.\n * When the user selects 100% (slider or Max), we cap the order at (1 - this) of the\n * theoretical max so that fees, rounding, and exchange-side margin checks are covered.\n * Value as decimal (e.g. 0.005 = 0.5%).\n */\nexport const MAX_ORDER_MARGIN_BUFFER = 0.005; // 0.5%\n\n/**\n * Performance optimization constants\n * These values control debouncing and throttling for better performance\n */\nexport const PERFORMANCE_CONFIG = {\n // Price updates debounce delay (milliseconds)\n // Batches rapid WebSocket price updates to reduce re-renders\n PriceUpdateDebounceMs: 1000,\n\n // Order validation debounce delay (milliseconds)\n // Prevents excessive validation calls during rapid form input changes\n ValidationDebounceMs: 300,\n\n // Freshness window for provider market metadata used by strategy capability reads\n OrderCapabilitiesMetaFreshnessMs: 30_000,\n\n // Liquidation price debounce delay (milliseconds)\n // Prevents excessive liquidation price calls during rapid form input changes\n LiquidationPriceDebounceMs: 500,\n\n // Candle subscription debounce delay (milliseconds)\n // Prevents WS subscription churn during rapid market switching (#28141)\n CandleConnectDebounceMs: 500,\n\n // Order-form slippage estimate throttle (milliseconds)\n // Updates the estimated-slippage value derived from the live L2 order book\n // no more than once per window. Aggressive enough to keep the row reactive\n // while the user edits the amount, conservative enough to avoid re-render\n // pressure on every book tick.\n SlippageEstimateThrottleMs: 250,\n\n // Order-book levels sampled when estimating slippage\n // Number of price levels (per side) walked by `calculateEstimatedSlippageBps`\n // to fill the requested USD notional. Matches the L2 sample size used by the\n // order-book panel and is enough depth for the typical order sizes we\n // surface in the order form.\n SlippageEstimateBookLevels: 10,\n\n // Candle WS teardown delay (milliseconds)\n // When the last subscriber for a cacheKey unsubscribes, wait this long before\n // tearing down the WS. A subsequent subscribe inside the window cancels the\n // teardown so rapid back-and-forth switches do not churn the connection.\n CandleTeardownDelayMs: 150,\n\n // Perps REST coalesce TTL (milliseconds)\n //\n // Window in which identical GET-style REST calls (getOrderFills, getOrders,\n // getFunding, historicalOrders) share a single in-flight promise / cached\n // result. `forceRefresh` still bypasses the cache end-to-end (hooks →\n // controller → MarketDataService → provider → HyperLiquidClientService), so\n // pull-to-refresh always hits the network.\n //\n // Why 60 s: HyperLiquid's documented rate limit is 1200 weight / IP /\n // rolling 60 s window. Sizing TTL = window length caps each endpoint-per-\n // account at ≤1 REST hit per window under any UI activity pattern — rapid\n // market switching, re-mounts (usePerpsMarketFills, usePerpsTransactionHistory),\n // and multi-tab scans all share a single request. Live fills/orders/prices\n // still flow via WS subscriptions, so REST is seed/backfill only — cache\n // staleness inside the 60 s window is never user-visible.\n PerpsRestCoalesceTtlMs: 60_000,\n\n // Candle snapshot REST coalesce TTL (milliseconds).\n // Longer than PerpsRestCoalesceTtlMs because WS stream keeps live candles\n // fresh — the REST snapshot only seeds the chart on initial subscribe. A\n // 30 s window lets rapid market switching (pass 1 → pass 2 of a stress\n // loop) share the same snapshot per (symbol, interval), cutting\n // candleSnapshot REST weight roughly in half.\n PerpsCandleCoalesceTtlMs: 30_000,\n\n // Navigation params delay (milliseconds)\n // Required for React Navigation to complete state transitions before setting params\n // This ensures navigation context is available when programmatically selecting tabs\n NavigationParamsDelayMs: 200,\n\n // Tab control reset delay (milliseconds)\n // Delay to reset programmatic tab control after tab switching to prevent render loops\n TabControlResetDelayMs: 500,\n\n // Market data cache duration (milliseconds)\n // How long to cache market list data before fetching fresh data\n MarketDataCacheDurationMs: 5 * 60 * 1000, // 5 minutes\n\n // Asset metadata cache duration (milliseconds)\n // How long to cache asset icon validation results\n AssetMetadataCacheDurationMs: 60 * 60 * 1000, // 1 hour\n\n // Max leverage cache duration (milliseconds)\n // How long to cache max leverage values per asset (leverage rarely changes)\n MaxLeverageCacheDurationMs: 60 * 60 * 1000, // 1 hour\n\n // Rewards cache durations (milliseconds)\n // How long to cache fee discount data from rewards API\n FeeDiscountCacheDurationMs: 5 * 60 * 1000, // 5 minutes\n // How long to cache points calculation parameters from rewards API\n PointsCalculationCacheDurationMs: 5 * 60 * 1000, // 5 minutes\n\n /**\n * Performance logging markers for filtering logs during development and debugging\n * These markers help isolate performance-related logs from general application logs\n * Usage: Use in DevLogger calls to easily filter specific performance areas\n * Impact: Development only (uses DevLogger) - zero production performance cost\n *\n * Examples:\n * - Filter Sentry performance logs: `adb logcat | grep PERPSMARK_SENTRY`\n * - Filter MetaMetrics events: `adb logcat | grep PERPSMARK_METRICS`\n * - Filter WebSocket performance: `adb logcat | grep PERPSMARK_WS`\n * - Filter all Perps performance: `adb logcat | grep PERPSMARK_`\n */\n LoggingMarkers: {\n // Sentry performance measurement logs (screen loads, bottom sheets, API timing)\n SentryPerformance: 'PERPSMARK_SENTRY',\n\n // MetaMetrics event tracking logs (user interactions, business analytics)\n MetametricsEvents: 'PERPSMARK_METRICS',\n\n // WebSocket performance logs (connection timing, data flow, reconnections)\n WebsocketPerformance: 'PERPSMARK_SENTRY_WS',\n } as const,\n} as const;\n\nexport const TP_SL_CONFIG = {\n UsePositionBoundTpsl: true,\n} as const;\n\n/**\n * Bounds applied to a HyperLiquid TWAP placement.\n *\n * The pinned HyperLiquid SDK (0.33.1) validates the TWAP duration as a safe\n * integer in `[5, 1440]` before signing, although the venue currently documents\n * a maximum of seven days (`10080` minutes). The controller exposes the SDK's\n * narrower cap until that dependency supports the venue limit, avoiding an\n * opaque SDK error. `MinNotionalUsd` is the venue's documented minimum *total*\n * order size for a TWAP, which it enforces instead of the per-order minimum —\n * its suborders are its own business.\n *\n * Carries the venue prefix, like `HYPERLIQUID_ORDER_LIMITS`, because these are\n * venue/SDK constraints rather than controller policy.\n *\n * From: https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types\n */\nexport const HYPERLIQUID_TWAP_LIMITS = {\n MinDurationMinutes: 5,\n MaxDurationMinutes: 1440,\n MinNotionalUsd: 100,\n} as const;\n\n/**\n * HyperLiquid order limits based on leverage\n * From: https://hyperliquid.gitbook.io/hyperliquid-docs/trading/contract-specifications\n */\nexport const HYPERLIQUID_ORDER_LIMITS = {\n // Market orders\n MarketOrderLimits: {\n // $15,000,000 for max leverage >= 25\n HighLeverage: 15_000_000,\n // $5,000,000 for max leverage in [20, 25)\n MediumHighLeverage: 5_000_000,\n // $2,000,000 for max leverage in [10, 20)\n MediumLeverage: 2_000_000,\n // $500,000 for max leverage < 10\n LowLeverage: 500_000,\n },\n // Limit orders are 10x market order limits\n LimitOrderMultiplier: 10,\n} as const;\n\n/**\n * Close position configuration\n * Controls behavior and constants specific to position closing\n */\nexport const CLOSE_POSITION_CONFIG = {\n // Decimal places for USD amount input display\n UsdDecimalPlaces: 2,\n\n // Default close percentage when opening the close position view\n DefaultClosePercentage: 100,\n\n // Precision for position size calculations to prevent rounding errors\n AmountCalculationPrecision: 6,\n\n // Throttle delay for real-time price updates during position closing\n PriceThrottleMs: 3000,\n\n // Fallback decimal places for tokens without metadata\n FallbackTokenDecimals: 18,\n} as const;\n\n/**\n * Margin adjustment configuration\n * Controls behavior for adding/removing margin from positions\n */\nexport const MARGIN_ADJUSTMENT_CONFIG = {\n // Risk thresholds for margin removal warnings\n // Threshold values represent ratio of (price distance to liquidation) / (liquidation price)\n // Values < 1.0 mean price is dangerously close to liquidation\n LiquidationRiskThreshold: 1.2, // 20% buffer before liquidation - triggers danger state\n LiquidationWarningThreshold: 1.5, // 50% buffer before liquidation - triggers warning state\n\n // Minimum margin adjustment amount (USD)\n // Prevents dust adjustments and ensures meaningful position changes\n MinAdjustmentAmount: 1,\n\n // Precision for margin calculations\n // Ensures accurate decimal handling in margin/leverage calculations\n CalculationPrecision: 6,\n\n // Safety buffer for margin removal to account for HyperLiquid's transfer margin requirement\n // HyperLiquid enforces: transfer_margin_required = max(initial_margin_required, 0.1 * total_position_value)\n // See: https://hyperliquid.gitbook.io/hyperliquid-docs/trading/margin-and-pnl\n MarginRemovalSafetyBuffer: 0.1,\n\n // Fallback max leverage when market data is unavailable\n // Conservative value to prevent over-removal of margin\n // Most HyperLiquid assets support at least 50x leverage\n FallbackMaxLeverage: 50,\n} as const;\n\n/**\n * Data Lake API configuration\n * Endpoints for reporting perps trading activity for notifications\n */\nexport const DATA_LAKE_API_CONFIG = {\n // Order reporting endpoint - only used for mainnet perps trading\n OrdersEndpoint: 'https://perps.api.cx.metamask.io/api/v1/orders',\n} as const;\n\n/**\n * Subscription benefits cache (stale-while-revalidate).\n *\n * The unified fee resolver never awaits the benefits read, so these bounds are\n * what decide whether the cached snapshot may grant the perps fee waiver:\n * - within `FreshMs` the snapshot is served as-is,\n * - past `FreshMs` it is still served while a background refresh runs,\n * - past `MaxStaleMs` it is no longer trusted to grant the waiver, and the\n * resolver falls back to the next-lowest fee source.\n */\nexport const SUBSCRIPTION_BENEFITS_CACHE = {\n FreshMs: 60_000, // 1 minute – no refresh triggered\n MaxStaleMs: 10 * 60 * 1000, // 10 minutes – ceiling for granting the waiver\n} as const;\n\n/**\n * Client order ID marking for the ADR 0064 subscription fee waiver.\n *\n * A HyperLiquid cloid is 16 bytes. When the subscription source wins the fee\n * comparison, the order's cloid is stamped so the fill can be attributed to the\n * subscription program off the existing HL fill fan-out, with no dedicated\n * builder address and no per-user approval:\n *\n * ```\n * 0x <program marker: 4 bytes> <flags: 1 byte> <entropy: 11 bytes>\n * ```\n *\n * The flag byte follows the leading marker rather than replacing it, so the\n * marking composes with the cloid the Scale ladder already builds: a Scale rung\n * keeps its own `4d4d5343` marker and its rung index, and only the flag byte is\n * claimed, leaving group recovery and cancel-by-cloid intact.\n *\n * `ProgramId` is isolated in this one constant so every marking and decoding\n * path reads the marker from a single place; see its own documentation below\n * for the registered value and how it is encoded.\n */\nexport const SUBSCRIPTION_CLOID_CONFIG = {\n /**\n * Reserved program marker, 4 bytes as lowercase hex without the `0x`.\n *\n * The registry assigns perps subscriptions program_id `0x0100`, from the\n * `0x0000`–`0x00FF`-adjacent range reserved for core protocol features. It is\n * a 2-byte id, zero-extended big-endian into this 4-byte marker field so the\n * rest of the layout — flag byte at a fixed offset, 11 bytes of entropy — is\n * unchanged. No previously released client emitted a cloid starting with\n * these bytes, and it cannot collide with the Scale marker (`4d4d5343`),\n * which is what makes the decoder safe against historical fills.\n */\n ProgramId: '00000100',\n\n /** Hex characters in the leading program marker (4 bytes). */\n ProgramIdHexLength: 8,\n\n /** Hex characters of trailing entropy in a marked cloid (11 bytes). */\n EntropyHexLength: 22,\n} as const;\n\n/**\n * Flag bits carried in the flag byte of a subscription-marked cloid.\n */\nexport const SUBSCRIPTION_CLOID_FLAGS = {\n /** Bit 0 — a subscription fee reduction was applied to this order. */\n FeeReductionApplied: 0x01,\n} as const;\n\n/**\n * Remote feature flag that gates the subscription fee-waiver source.\n *\n * ADR 0064 Milestone 8 requires the subscription source to be killable on its\n * own, without touching VIP, season, or the default builder fee. Absent or\n * malformed, the flag reads as enabled so an unreachable flag service cannot\n * silently drop a benefit the user pays for.\n */\nexport const SUBSCRIPTION_FEE_WAIVER_FLAG = 'perpsSubscriptionFeeWaiverEnabled';\n\n/**\n * Terminal API configuration.\n * The full endpoint URL is injected at runtime via\n * `PerpsPlatformDependencies.terminalApi.marketDataUrl` from each client build\n * (dev/uat/prd); only cache settings live here.\n */\nexport const TERMINAL_API_CONFIG = {\n CacheTtlMs: 5 * 60 * 1000, // 5 minutes\n FetchTimeoutMs: 10_000, // 10 seconds – degrade to provider on slow Terminal\n} as const;\n\n/**\n * Decimal precision configuration\n * Controls maximum decimal places for price and input validation\n */\nexport const DECIMAL_PRECISION_CONFIG = {\n // Maximum decimal places for price input (matches Hyperliquid limit)\n // Used in TP/SL forms, limit price inputs, and price validation\n MaxPriceDecimals: 6,\n // Maximum significant figures allowed by HyperLiquid API\n // Orders with more than 5 significant figures will be rejected\n MaxSignificantFigures: 5,\n // Defensive fallback for size decimals when market data fails to load\n // Real szDecimals should always come from market data API (varies by asset)\n // Using 6 as safe maximum to prevent crashes (covers most assets)\n // NOTE: This is NOT semantically correct - just a defensive measure\n FallbackSizeDecimals: 6,\n} as const;\n\n/**\n * Decimal places kept by the shared TP/SL calculations.\n *\n * A calculated trigger price keeps the decimals of the first band whose\n * `BelowPrice` it is under, else `TriggerPriceDefaultDecimals`, without\n * trailing zeros: low-priced assets need more decimals. The provider rounds\n * the price to the asset's submission precision when the order is sent.\n */\nexport const TP_SL_PRECISION_CONFIG = {\n TriggerPriceBands: [\n { BelowPrice: 0.01, Decimals: 8 },\n { BelowPrice: 1, Decimals: DECIMAL_PRECISION_CONFIG.MaxPriceDecimals },\n { BelowPrice: 100, Decimals: 4 },\n ],\n TriggerPriceDefaultDecimals: 2,\n // Decimal places of a calculated or displayed RoE or price-move percentage\n PercentageDecimals: 2,\n} as const;\n\n/**\n * Market sorting configuration\n * Controls sorting behavior and presets for the trending markets view\n */\nexport const MARKET_SORTING_CONFIG = {\n // Default sort settings\n DefaultSortOptionId: 'volume' as const,\n DefaultDirection: 'desc' as const,\n\n // Available sort fields (only includes fields supported by PerpsMarketData)\n SortFields: {\n Volume: 'volume',\n PriceChange: 'priceChange',\n OpenInterest: 'openInterest',\n FundingRate: 'fundingRate',\n } as const,\n\n // Sort button presets for filter chips (simplified buttons without direction)\n SortButtonPresets: [\n { field: 'volume', labelKey: 'perps.sort.volume' },\n { field: 'priceChange', labelKey: 'perps.sort.price_change' },\n { field: 'fundingRate', labelKey: 'perps.sort.funding_rate' },\n ] as const,\n\n // Sort options for the bottom sheet\n // All options support direction toggle (high-to-low / low-to-high)\n SortOptions: [\n {\n id: 'volume',\n labelKey: 'perps.sort.volume',\n field: 'volume',\n direction: 'desc',\n },\n {\n id: 'priceChange',\n labelKey: 'perps.sort.price_change',\n field: 'priceChange',\n direction: 'desc',\n },\n {\n id: 'openInterest',\n labelKey: 'perps.sort.open_interest',\n field: 'openInterest',\n direction: 'desc',\n },\n {\n id: 'fundingRate',\n labelKey: 'perps.sort.funding_rate',\n field: 'fundingRate',\n direction: 'desc',\n },\n ] as const,\n} as const;\n\n/**\n * Type for valid sort option IDs\n * Derived from SORT_OPTIONS to ensure type safety\n * Valid values: 'volume' | 'priceChange' | 'openInterest' | 'fundingRate'\n */\nexport type SortOptionId =\n (typeof MARKET_SORTING_CONFIG.SortOptions)[number]['id'];\n\n/**\n * Perps interface mode.\n *\n * `Lite` is the simplified default experience; `Pro` exposes the advanced\n * trading layout (chart, order book, inline order form).\n */\nexport enum PerpsMode {\n Lite = 'lite',\n Pro = 'pro',\n}\n\n/**\n * Side filter for the Pro Positions list (long/short/all).\n *\n * Independent of `ordersSideFilter`. Shared across markets via\n * `proLayoutPreferences.positionsSideFilter`.\n */\nexport type ProPositionsSideFilter = 'all' | 'long' | 'short';\n\n/**\n * Sort fields available on the Pro Positions list.\n */\nexport type ProPositionsSortField =\n | 'positionValue'\n | 'unrealizedPnl'\n | 'fundingRate';\n\n/**\n * Sort direction for the Pro Positions list.\n */\nexport type ProPositionsSortDirection = 'asc' | 'desc';\n\n/**\n * Side filter for the Pro Orders list (long/short/all).\n *\n * Independent of `positionsSideFilter`. Shared across markets via\n * `proLayoutPreferences.ordersSideFilter`.\n */\nexport type ProOrdersSideFilter = 'all' | 'long' | 'short';\n\n/**\n * Sort fields available on the Pro Orders list.\n */\nexport type ProOrdersSortField = 'orderValue' | 'size' | 'price' | 'time';\n\n/**\n * Sort direction for the Pro Orders list.\n */\nexport type ProOrdersSortDirection = 'asc' | 'desc';\n\n/**\n * Currency used by the Pro order-book size/total column.\n */\nexport type OrderBookListCurrency = 'base' | 'usd';\n\n/**\n * Value shown by the Pro order-book size/total column.\n */\nexport type OrderBookListMetric = 'size' | 'total';\n\n/**\n * Market-agnostic Pro order-book display preferences.\n */\nexport type OrderBookPreferences = {\n currency: OrderBookListCurrency;\n metric: OrderBookListMetric;\n};\n\n/**\n * Default Pro order-book display preferences.\n */\nexport const DEFAULT_ORDER_BOOK_PREFERENCES: OrderBookPreferences = {\n currency: 'usd',\n metric: 'total',\n};\n\n/**\n * Pro-mode layout preferences (network-independent).\n *\n * Flat object that persists across markets (unlike the per-market\n * `tradeConfigurations`). `chartExpanded` and the `*Position` fields are\n * reserved for future container-position UI. Positions and Orders each have\n * their own side filter and sort so they survive market navigation and app\n * restarts independently.\n */\nexport type ProLayoutPreferences = {\n orderBookExpanded: boolean;\n chartExpanded: boolean;\n orderBookPosition: 'left' | 'right';\n orderFormPosition: 'left' | 'right';\n positionsSideFilter: ProPositionsSideFilter;\n positionsSortField: ProPositionsSortField;\n positionsSortDirection: ProPositionsSortDirection;\n ordersSideFilter: ProOrdersSideFilter;\n ordersSortField: ProOrdersSortField;\n ordersSortDirection: ProOrdersSortDirection;\n};\n\n/**\n * Default pro-mode layout preferences.\n *\n * Shared by `getDefaultPerpsControllerState()`, the controller getter, and the\n * selector so callers always receive a fully-populated object even when the\n * persisted state predates this field.\n */\nexport const DEFAULT_PRO_LAYOUT_PREFERENCES: ProLayoutPreferences = {\n orderBookExpanded: false,\n chartExpanded: true,\n orderBookPosition: 'left',\n orderFormPosition: 'right',\n positionsSideFilter: 'all',\n positionsSortField: 'positionValue',\n positionsSortDirection: 'desc',\n ordersSideFilter: 'all',\n ordersSortField: 'time',\n ordersSortDirection: 'desc',\n};\n\n/**\n * Default Perps interface mode.\n */\nexport const DEFAULT_PERPS_MODE: PerpsMode = PerpsMode.Lite;\n\n/**\n * Default market-agnostic order type.\n */\nexport const DEFAULT_SELECTED_ORDER_TYPE = 'market' as const;\n\n/**\n * Funding rate display configuration\n * Controls how funding rates are formatted and displayed\n */\nexport const FUNDING_RATE_CONFIG = {\n // Number of decimal places to display for funding rates\n Decimals: 4,\n // Default display value when funding rate is zero or unavailable\n ZeroDisplay: '0.0000%',\n // Multiplier to convert decimal funding rate to percentage\n PercentageMultiplier: 100,\n} as const;\n\n/**\n * Decimal places shown for each displayed perps value, shared by Mobile,\n * Extension and Terminal. Pass one as the `decimals` option of the display\n * formatters (`formatPercentage`, `formatPnl`, `formatPerpsFiat`,\n * `formatFundingRate`, `formatFeeBps`, `formatLiquidationDistance`,\n * `formatPerpsCompact`, `formatPerpsUsdInput`). Prices follow\n * `PRICE_RANGES_UNIVERSAL` instead.\n */\nexport const PERPS_DISPLAY_PRECISION = {\n // Generic percentage, such as the 24h change: \"+5.25%\"\n Percentage: 2,\n // Return on equity: \"+10.3%\"\n RoePercent: 1,\n // Profit and loss in USD: \"+$12.34\"\n Pnl: 2,\n // Fee amount in USD: \"$1.50\"\n Fee: 2,\n // Fee rate as a percentage: \"0.045%\"\n FeeRatePercent: 3,\n // Funding rate as a percentage: \"0.0125%\"\n FundingRatePercent: FUNDING_RATE_CONFIG.Decimals,\n // Estimated slippage of an order as a percentage: \"0.0021%\"\n SlippageEstimatePercent: 4,\n // Most decimals a displayed price may have (Hyperliquid limit)\n MaxPriceDecimals: DECIMAL_PRECISION_CONFIG.MaxPriceDecimals,\n // Most decimals of a fee in basis points: \"4.5 bps\", \"1.44 bps\"\n FeeBps: 2,\n // Distance from the liquidation price as a percentage: \"30.00%\"\n LiquidationDistancePercent: 2,\n // Most decimals of TWAP progress as a percentage: \"25%\", \"33.33%\"\n TwapProgressPercent: 2,\n // Most decimals of a typed USD amount: \"12.34\"\n UsdInput: 2,\n // Most digits of a typed USD amount, integer and fraction together\n UsdInputMaxDigits: 9,\n // Volume and open interest from $1M up, and below $1K: \"$1.23M\", \"$999.50\"\n VolumeCompact: 2,\n // Volume and open interest in thousands: \"$123K\"\n VolumeCompactThousands: 0,\n // Order book size and total from 1K up: \"$2.1K\", \"604.9K\"\n OrderBookCompact: 1,\n // Most decimals of an abbreviated order book price: \"$61.47K\"\n OrderBookAbbreviatedPriceMax: 3,\n} as const;\n\n/**\n * Provider configuration for multi-provider support\n */\nexport const PROVIDER_CONFIG = {\n /** Default perpetual DEX provider when no explicit selection exists */\n DefaultProvider: 'hyperliquid' as const,\n /**\n * Force Lighter to testnet only. Off: Lighter follows the global network\n * toggle — mainnet reads AND writes are enabled (the initial rollout\n * write gate was removed once the write path was validated end-to-end\n * on testnet). Flip on to pin Lighter to testnet regardless of the\n * global network toggle.\n */\n LIGHTER_TESTNET_ONLY: false,\n} as const;\n\n// Disk-backed cold-start cache keys and throttle interval.\n// The user-data key ends in _V2 because the AccountState balance contract\n// changed (TAT-3047) and has no in-payload version field. Bumping the key\n// forces a one-time empty cache on upgrade — consumers fall through to\n// skeleton/fallback until the first WS tick, avoiding stale legacy-shape\n// reads that would surface as $0 balances.\nexport const PERPS_DISK_CACHE_MARKETS = 'PERPS_DISK_CACHE_MARKETS';\nexport const PERPS_DISK_CACHE_USER_DATA = 'PERPS_DISK_CACHE_USER_DATA_V2';\nexport const PERPS_DISK_CACHE_THROTTLE_MS = 30_000;\n\n/**\n * Minimum interval between WebSocket-triggered HL `userAbstraction`\n * refreshes. Balances picking up HL-web mode flips (Unified ↔ Standard)\n * promptly against burning REST quota on every spot tick. Covers the\n * observed user pattern of flipping mode once per session at most.\n */\nexport const ABSTRACTION_MODE_REFRESH_THROTTLE_MS = 60_000;\n\n/**\n * Build the standard provider:network cache key from controller state.\n *\n * @param state - Controller state containing provider and network info.\n * @param state.activeProvider - Active perps provider name.\n * @param state.isTestnet - Whether testnet mode is active.\n * @returns Cache key in the format \"provider:mainnet\" or \"provider:testnet\".\n */\nexport function getProviderNetworkKey(state: {\n activeProvider?: string;\n isTestnet?: boolean;\n}): string {\n return `${state.activeProvider ?? PROVIDER_CONFIG.DefaultProvider}:${state.isTestnet ? 'testnet' : 'mainnet'}`;\n}\n\n/**\n * Build a provider:network cache key for a specific provider id.\n * Accounts for LIGHTER_TESTNET_ONLY: when set, Lighter stays on testnet\n * regardless of the global network flag.\n *\n * @param providerId - The provider identifier (e.g. \"hyperliquid\", \"lighter\").\n * @param isTestnet - Global testnet flag from controller state.\n * @returns Cache key in the format \"provider:mainnet\" or \"provider:testnet\".\n */\nexport function buildProviderCacheKey(\n providerId: string,\n isTestnet: boolean,\n): string {\n let effectiveTestnet = isTestnet;\n if (providerId === 'lighter') {\n effectiveTestnet = PROVIDER_CONFIG.LIGHTER_TESTNET_ONLY || isTestnet;\n }\n return `${providerId}:${effectiveTestnet ? 'testnet' : 'mainnet'}`;\n}\n"]}
1
+ {"version":3,"file":"perpsConfig.js","sourceRoot":"","sources":["../../src/constants/perpsConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,4CAA4C,CAAC;AACzE,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;AAElC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,cAAc,EAAE,cAAc;IAC9B,WAAW,EAAE,OAAO,EAAE,kFAAkF;IACxG,sGAAsG;IACtG,4BAA4B,EAAE,eAAe;IAC7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;AACH,MAAM,UAAU,qBAAqB,CACnC,UAAkB,EAClB,SAAkB;IAElB,IAAI,gBAAgB,GAAG,SAAS,CAAC;IACjC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,gBAAgB,GAAG,eAAe,CAAC,oBAAoB,IAAI,SAAS,CAAC;IACvE,CAAC;IACD,OAAO,GAAG,UAAU,IAAI,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AACrE,CAAC","sourcesContent":["/**\n * Perps feature constants - Controller layer (portable)\n *\n * This file contains only controller-portable configuration:\n * - Constants used by controller logic, providers, and services\n * - Calculation thresholds, API configs, and protocol constants\n *\n * UI-only constants (layout, display, navigation) live in:\n * app/components/UI/Perps/constants/perpsConfig.ts\n */\nexport const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';\nexport const ZERO_BALANCE = '0x0';\n\nexport const PERPS_CONSTANTS = {\n FeatureFlagKey: 'perpsEnabled',\n FeatureName: 'perps', // Constant for Sentry error filtering - enables \"feature:perps\" dashboard queries\n /** Token description used to identify the synthetic \"Perps balance\" option in pay-with token lists */\n PerpsBalanceTokenDescription: 'perps-balance',\n /** Symbol displayed for the synthetic \"Perps balance\" token in pay-with token lists */\n PerpsBalanceTokenSymbol: 'USD',\n WebsocketTimeout: 5000, // 5 seconds\n WebsocketCleanupDelay: 1000, // 1 second\n BackgroundDisconnectDelay: 20_000, // 20 seconds delay before disconnecting when app is backgrounded or when user exits perps UX\n ConnectionTimeoutMs: 10_000, // 10 seconds timeout for connection and position loading states\n DefaultMonitoringTimeoutMs: 10_000, // 10 seconds default timeout for data monitoring operations\n\n // Connection timing constants\n ConnectionGracePeriodMs: 20_000, // 20 seconds grace period before actual disconnection (same as BackgroundDisconnectDelay for semantic clarity)\n ConnectionAttemptTimeoutMs: 30_000, // 30 seconds timeout for connection attempts to prevent indefinite hanging\n WebsocketPingTimeoutMs: 5_000, // 5 seconds timeout for WebSocket health check ping\n ConnectRetryDelayMs: 200, // Delay before retrying connect() when connection isn't ready yet\n ForegroundPingRetryDelayMs: 500, // Delay before retrying ping in resumeFromForeground — JS thread may be sluggish right after foregrounding\n ReconnectionCleanupDelayMs: 500, // Platform-agnostic delay to ensure WebSocket is ready\n ReconnectionDelayAndroidMs: 300, // Android-specific reconnection delay for better reliability on slower devices\n ReconnectionDelayIosMs: 100, // iOS-specific reconnection delay for optimal performance\n ReconnectionRetryDelayMs: 5_000, // 5 seconds delay between reconnection attempts\n NetworkRestoreMaxRetries: 8, // Max retry attempts when reconnecting after WiFi/network restore\n NetworkRestoreRetryBaseMs: 1_500, // Base delay (ms) between network restore retries (multiplied by attempt number)\n\n // Connection manager timing constants\n BalanceUpdateThrottleMs: 15000, // Update at most every 15 seconds to reduce state updates in PerpsConnectionManager\n InitialDataDelayMs: 100, // Delay to allow initial data to load after connection establishment\n\n // Order submission timing\n PlaceOrderTimeoutMs: 60_000, // Hard timeout for provider round-trip in TradingService.placeOrder\n\n // Deposit toast timing\n DepositTakingLongerToastDelayMs: 30_000, // Delay before showing \"Deposit taking longer than usual\" toast\n\n DefaultAssetPreviewLimit: 5,\n DefaultMaxLeverage: 3 as number, // Default fallback max leverage when market data is unavailable - conservative default\n FallbackPriceDisplay: '$---', // Display when price data is unavailable\n FallbackPercentageDisplay: '--%', // Display when change data is unavailable\n FallbackDataDisplay: '--', // Display when non-price data is unavailable\n ZeroAmountDisplay: '$0', // Display for zero dollar amounts (e.g., no volume)\n ZeroAmountDetailedDisplay: '$0.00', // Display for zero dollar amounts with decimals\n\n RecentActivityLimit: 3,\n\n // Historical data fetching constants\n FillsLookbackMs: 90 * 24 * 60 * 60 * 1000, // 3 months in milliseconds - limits REST API fills fetch\n\n // Recently viewed markets\n RecentlyViewedMarketsTtlMs: 24 * 60 * 60 * 1000, // 24 hours TTL for recently viewed market entries\n RecentlyViewedMarketsLimit: 10, // Maximum number of recently viewed markets to track\n\n // Temporary order form draft\n PendingTradeConfigurationTtlMs: 30_000, // Restore a draft only during a brief navigation away from the form\n} as const;\n\n/**\n * Withdrawal-specific constants (protocol-agnostic)\n * Note: Protocol-specific values like estimated time should be defined in each protocol's config\n */\nexport const WITHDRAWAL_CONSTANTS = {\n DefaultMinAmount: '1.01', // Default minimum withdrawal amount in USDC\n DefaultFeeAmount: 1, // Default withdrawal fee in USDC\n DefaultFeeToken: 'USDC', // Default fee token\n} as const;\n\n/**\n * Validation thresholds for UI warnings and checks\n * These values control when warnings are shown to users\n */\nexport const VALIDATION_THRESHOLDS = {\n // Leverage threshold for warning users about high leverage\n HighLeverageWarning: 20, // Show warning when leverage > 20x\n\n // Limit price difference threshold (as decimal, 0.1 = 10%)\n LimitPriceDifferenceWarning: 0.1, // Warn if limit price differs by >10% from current price\n\n // Price deviation threshold (as decimal, 0.1 = 10%)\n PriceDeviation: 0.1, // Warn if perps price deviates by >10% from spot price\n} as const;\n\n/**\n * Order slippage configuration\n * Controls default slippage tolerance for different order types\n * Conservative defaults based on HyperLiquid platform interface\n * See: docs/perps/hyperliquid/ORDER-MATCHING-ERRORS.md\n */\nexport const ORDER_SLIPPAGE_CONFIG = {\n // Market order slippage (basis points)\n // 300 basis points = 3% = 0.03 decimal\n // Conservative default for measured rollout, prevents most IOC failures\n DefaultMarketSlippageBps: 300,\n\n // TP/SL order slippage (basis points)\n // 1000 basis points = 10% = 0.10 decimal\n // Aligns with HyperLiquid platform default for triggered orders\n DefaultTpslSlippageBps: 1000,\n\n // Limit order slippage (basis points)\n // 100 basis points = 1% = 0.01 decimal\n // Kept conservative as limit orders rest on book (not IOC/immediate execution)\n DefaultLimitSlippageBps: 100,\n} as const;\n\n/**\n * Defaults and bounds for the emulated `chase` placement.\n *\n * No supported venue exposes a chase as an API action — HyperLiquid documents it\n * as running client-side — so the strategy is run here: a post-only order rests\n * one tick inside the spread and is cancelled and re-placed as the touch moves.\n * The poll floor limits request frequency; callers may also set explicit\n * duration or repricing caps. Protocol-agnostic — a provider that gains a\n * native chase ignores these entirely.\n */\nexport const CHASE_ORDER_CONFIG = {\n /** Maximum submissions used to survive a touch moving before an ALO rests. */\n InitialPlacementAttempts: 3,\n /** How often the touch is re-read when the caller does not say. */\n DefaultIntervalMs: 15000,\n /** Floor on the poll interval, whatever the caller asks for. */\n MinIntervalMs: 1000,\n /**\n * How many chases may run at once.\n *\n * HyperLiquid documents a cap of five simultaneously active chase orders. It\n * is a venue rule rather than controller policy, but it is spelled here\n * alongside the rest of the chase configuration because an emulated chase is\n * the only thing that can enforce it.\n */\n MaxActiveSessions: 5,\n} as const;\n\n/** Public lifecycle states reported for an emulated Chase order. */\nexport const CHASE_ORDER_STATUS = {\n Active: 'active',\n TerminationPending: 'termination_pending',\n Backgrounded: 'backgrounded',\n MaxDistanceReached: 'max_distance_reached',\n DurationReached: 'duration_reached',\n RepricingLimitReached: 'repricing_limit_reached',\n Filled: 'filled',\n Canceled: 'canceled',\n Failed: 'failed',\n} as const;\n\n/**\n * Bounds and step for the user-configurable max slippage preference (basis points).\n * Shared by the controller (`setMaxSlippage`) and UI (`slippageConfig.ts`).\n */\nexport const MAX_SLIPPAGE_BOUNDS = {\n MinBps: 10,\n MaxBps: 1000,\n StepBps: 10,\n} as const;\n\n/**\n * Max order amount buffer to reduce \"Insufficient margin\" rejections from the exchange.\n * When the user selects 100% (slider or Max), we cap the order at (1 - this) of the\n * theoretical max so that fees, rounding, and exchange-side margin checks are covered.\n * Value as decimal (e.g. 0.005 = 0.5%).\n */\nexport const MAX_ORDER_MARGIN_BUFFER = 0.005; // 0.5%\n\n/**\n * Performance optimization constants\n * These values control debouncing and throttling for better performance\n */\nexport const PERFORMANCE_CONFIG = {\n // Price updates debounce delay (milliseconds)\n // Batches rapid WebSocket price updates to reduce re-renders\n PriceUpdateDebounceMs: 1000,\n\n // Order validation debounce delay (milliseconds)\n // Prevents excessive validation calls during rapid form input changes\n ValidationDebounceMs: 300,\n\n // Freshness window for provider market metadata used by strategy capability reads\n OrderCapabilitiesMetaFreshnessMs: 30_000,\n\n // Liquidation price debounce delay (milliseconds)\n // Prevents excessive liquidation price calls during rapid form input changes\n LiquidationPriceDebounceMs: 500,\n\n // Candle subscription debounce delay (milliseconds)\n // Prevents WS subscription churn during rapid market switching (#28141)\n CandleConnectDebounceMs: 500,\n\n // Order-form slippage estimate throttle (milliseconds)\n // Updates the estimated-slippage value derived from the live L2 order book\n // no more than once per window. Aggressive enough to keep the row reactive\n // while the user edits the amount, conservative enough to avoid re-render\n // pressure on every book tick.\n SlippageEstimateThrottleMs: 250,\n\n // Order-book levels sampled when estimating slippage\n // Number of price levels (per side) walked by `calculateEstimatedSlippageBps`\n // to fill the requested USD notional. Matches the L2 sample size used by the\n // order-book panel and is enough depth for the typical order sizes we\n // surface in the order form.\n SlippageEstimateBookLevels: 10,\n\n // Candle WS teardown delay (milliseconds)\n // When the last subscriber for a cacheKey unsubscribes, wait this long before\n // tearing down the WS. A subsequent subscribe inside the window cancels the\n // teardown so rapid back-and-forth switches do not churn the connection.\n CandleTeardownDelayMs: 150,\n\n // Perps REST coalesce TTL (milliseconds)\n //\n // Window in which identical GET-style REST calls (getOrderFills, getOrders,\n // getFunding, historicalOrders) share a single in-flight promise / cached\n // result. `forceRefresh` still bypasses the cache end-to-end (hooks →\n // controller → MarketDataService → provider → HyperLiquidClientService), so\n // pull-to-refresh always hits the network.\n //\n // Why 60 s: HyperLiquid's documented rate limit is 1200 weight / IP /\n // rolling 60 s window. Sizing TTL = window length caps each endpoint-per-\n // account at ≤1 REST hit per window under any UI activity pattern — rapid\n // market switching, re-mounts (usePerpsMarketFills, usePerpsTransactionHistory),\n // and multi-tab scans all share a single request. Live fills/orders/prices\n // still flow via WS subscriptions, so REST is seed/backfill only — cache\n // staleness inside the 60 s window is never user-visible.\n PerpsRestCoalesceTtlMs: 60_000,\n\n // Candle snapshot REST coalesce TTL (milliseconds).\n // Longer than PerpsRestCoalesceTtlMs because WS stream keeps live candles\n // fresh — the REST snapshot only seeds the chart on initial subscribe. A\n // 30 s window lets rapid market switching (pass 1 → pass 2 of a stress\n // loop) share the same snapshot per (symbol, interval), cutting\n // candleSnapshot REST weight roughly in half.\n PerpsCandleCoalesceTtlMs: 30_000,\n\n // Navigation params delay (milliseconds)\n // Required for React Navigation to complete state transitions before setting params\n // This ensures navigation context is available when programmatically selecting tabs\n NavigationParamsDelayMs: 200,\n\n // Tab control reset delay (milliseconds)\n // Delay to reset programmatic tab control after tab switching to prevent render loops\n TabControlResetDelayMs: 500,\n\n // Market data cache duration (milliseconds)\n // How long to cache market list data before fetching fresh data\n MarketDataCacheDurationMs: 5 * 60 * 1000, // 5 minutes\n\n // Asset metadata cache duration (milliseconds)\n // How long to cache asset icon validation results\n AssetMetadataCacheDurationMs: 60 * 60 * 1000, // 1 hour\n\n // Max leverage cache duration (milliseconds)\n // How long to cache max leverage values per asset (leverage rarely changes)\n MaxLeverageCacheDurationMs: 60 * 60 * 1000, // 1 hour\n\n // Rewards cache durations (milliseconds)\n // How long to cache fee discount data from rewards API\n FeeDiscountCacheDurationMs: 5 * 60 * 1000, // 5 minutes\n // How long to cache points calculation parameters from rewards API\n PointsCalculationCacheDurationMs: 5 * 60 * 1000, // 5 minutes\n\n /**\n * Performance logging markers for filtering logs during development and debugging\n * These markers help isolate performance-related logs from general application logs\n * Usage: Use in DevLogger calls to easily filter specific performance areas\n * Impact: Development only (uses DevLogger) - zero production performance cost\n *\n * Examples:\n * - Filter Sentry performance logs: `adb logcat | grep PERPSMARK_SENTRY`\n * - Filter MetaMetrics events: `adb logcat | grep PERPSMARK_METRICS`\n * - Filter WebSocket performance: `adb logcat | grep PERPSMARK_WS`\n * - Filter all Perps performance: `adb logcat | grep PERPSMARK_`\n */\n LoggingMarkers: {\n // Sentry performance measurement logs (screen loads, bottom sheets, API timing)\n SentryPerformance: 'PERPSMARK_SENTRY',\n\n // MetaMetrics event tracking logs (user interactions, business analytics)\n MetametricsEvents: 'PERPSMARK_METRICS',\n\n // WebSocket performance logs (connection timing, data flow, reconnections)\n WebsocketPerformance: 'PERPSMARK_SENTRY_WS',\n } as const,\n} as const;\n\nexport const TP_SL_CONFIG = {\n UsePositionBoundTpsl: true,\n} as const;\n\n/**\n * Bounds applied to a HyperLiquid TWAP placement.\n *\n * The pinned HyperLiquid SDK (0.33.1) validates the TWAP duration as a safe\n * integer in `[5, 1440]` before signing, although the venue currently documents\n * a maximum of seven days (`10080` minutes). The controller exposes the SDK's\n * narrower cap until that dependency supports the venue limit, avoiding an\n * opaque SDK error. `MinNotionalUsd` is the venue's documented minimum *total*\n * order size for a TWAP, which it enforces instead of the per-order minimum —\n * its suborders are its own business.\n *\n * Carries the venue prefix, like `HYPERLIQUID_ORDER_LIMITS`, because these are\n * venue/SDK constraints rather than controller policy.\n *\n * From: https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types\n */\nexport const HYPERLIQUID_TWAP_LIMITS = {\n MinDurationMinutes: 5,\n MaxDurationMinutes: 1440,\n MinNotionalUsd: 100,\n} as const;\n\n/**\n * HyperLiquid order limits based on leverage\n * From: https://hyperliquid.gitbook.io/hyperliquid-docs/trading/contract-specifications\n */\nexport const HYPERLIQUID_ORDER_LIMITS = {\n // Market orders\n MarketOrderLimits: {\n // $15,000,000 for max leverage >= 25\n HighLeverage: 15_000_000,\n // $5,000,000 for max leverage in [20, 25)\n MediumHighLeverage: 5_000_000,\n // $2,000,000 for max leverage in [10, 20)\n MediumLeverage: 2_000_000,\n // $500,000 for max leverage < 10\n LowLeverage: 500_000,\n },\n // Limit orders are 10x market order limits\n LimitOrderMultiplier: 10,\n} as const;\n\n/**\n * Close position configuration\n * Controls behavior and constants specific to position closing\n */\nexport const CLOSE_POSITION_CONFIG = {\n // Decimal places for USD amount input display\n UsdDecimalPlaces: 2,\n\n // Default close percentage when opening the close position view\n DefaultClosePercentage: 100,\n\n // Precision for position size calculations to prevent rounding errors\n AmountCalculationPrecision: 6,\n\n // Throttle delay for real-time price updates during position closing\n PriceThrottleMs: 3000,\n\n // Fallback decimal places for tokens without metadata\n FallbackTokenDecimals: 18,\n} as const;\n\n/**\n * Margin adjustment configuration\n * Controls behavior for adding/removing margin from positions\n */\nexport const MARGIN_ADJUSTMENT_CONFIG = {\n // Risk thresholds for margin removal warnings\n // Threshold values represent ratio of (price distance to liquidation) / (liquidation price)\n // Values < 1.0 mean price is dangerously close to liquidation\n LiquidationRiskThreshold: 1.2, // 20% buffer before liquidation - triggers danger state\n LiquidationWarningThreshold: 1.5, // 50% buffer before liquidation - triggers warning state\n\n // Minimum margin adjustment amount (USD)\n // Prevents dust adjustments and ensures meaningful position changes\n MinAdjustmentAmount: 1,\n\n // Precision for margin calculations\n // Ensures accurate decimal handling in margin/leverage calculations\n CalculationPrecision: 6,\n\n // Safety buffer for margin removal to account for HyperLiquid's transfer margin requirement\n // HyperLiquid enforces: transfer_margin_required = max(initial_margin_required, 0.1 * total_position_value)\n // See: https://hyperliquid.gitbook.io/hyperliquid-docs/trading/margin-and-pnl\n MarginRemovalSafetyBuffer: 0.1,\n\n // Share of notional kept back from a margin removal for the mark price\n // moving before the venue processes it; the exact boundary is rejected on\n // any adverse tick\n MarginRemovalPriceMoveBuffer: 0.01,\n\n // Fallback max leverage when market data is unavailable\n // Conservative value to prevent over-removal of margin\n // Most HyperLiquid assets support at least 50x leverage\n FallbackMaxLeverage: 50,\n} as const;\n\n/**\n * Data Lake API configuration\n * Endpoints for reporting perps trading activity for notifications\n */\nexport const DATA_LAKE_API_CONFIG = {\n // Order reporting endpoint - only used for mainnet perps trading\n OrdersEndpoint: 'https://perps.api.cx.metamask.io/api/v1/orders',\n} as const;\n\n/**\n * Subscription benefits cache (stale-while-revalidate).\n *\n * The unified fee resolver never awaits the benefits read, so these bounds are\n * what decide whether the cached snapshot may grant the perps fee waiver:\n * - within `FreshMs` the snapshot is served as-is,\n * - past `FreshMs` it is still served while a background refresh runs,\n * - past `MaxStaleMs` it is no longer trusted to grant the waiver, and the\n * resolver falls back to the next-lowest fee source.\n */\nexport const SUBSCRIPTION_BENEFITS_CACHE = {\n FreshMs: 60_000, // 1 minute – no refresh triggered\n MaxStaleMs: 10 * 60 * 1000, // 10 minutes – ceiling for granting the waiver\n} as const;\n\n/**\n * Client order ID marking for the ADR 0064 subscription fee waiver.\n *\n * A HyperLiquid cloid is 16 bytes. When the subscription source wins the fee\n * comparison, the order's cloid is stamped so the fill can be attributed to the\n * subscription program off the existing HL fill fan-out, with no dedicated\n * builder address and no per-user approval:\n *\n * ```\n * 0x <program marker: 4 bytes> <flags: 1 byte> <entropy: 11 bytes>\n * ```\n *\n * The flag byte follows the leading marker rather than replacing it, so the\n * marking composes with the cloid the Scale ladder already builds: a Scale rung\n * keeps its own `4d4d5343` marker and its rung index, and only the flag byte is\n * claimed, leaving group recovery and cancel-by-cloid intact.\n *\n * `ProgramId` is isolated in this one constant so every marking and decoding\n * path reads the marker from a single place; see its own documentation below\n * for the registered value and how it is encoded.\n */\nexport const SUBSCRIPTION_CLOID_CONFIG = {\n /**\n * Reserved program marker, 4 bytes as lowercase hex without the `0x`.\n *\n * The registry assigns perps subscriptions program_id `0x0100`, from the\n * `0x0000`–`0x00FF`-adjacent range reserved for core protocol features. It is\n * a 2-byte id, zero-extended big-endian into this 4-byte marker field so the\n * rest of the layout — flag byte at a fixed offset, 11 bytes of entropy — is\n * unchanged. No previously released client emitted a cloid starting with\n * these bytes, and it cannot collide with the Scale marker (`4d4d5343`),\n * which is what makes the decoder safe against historical fills.\n */\n ProgramId: '00000100',\n\n /** Hex characters in the leading program marker (4 bytes). */\n ProgramIdHexLength: 8,\n\n /** Hex characters of trailing entropy in a marked cloid (11 bytes). */\n EntropyHexLength: 22,\n} as const;\n\n/**\n * Flag bits carried in the flag byte of a subscription-marked cloid.\n */\nexport const SUBSCRIPTION_CLOID_FLAGS = {\n /** Bit 0 — a subscription fee reduction was applied to this order. */\n FeeReductionApplied: 0x01,\n} as const;\n\n/**\n * Remote feature flag that gates the subscription fee-waiver source.\n *\n * ADR 0064 Milestone 8 requires the subscription source to be killable on its\n * own, without touching VIP, season, or the default builder fee. Absent or\n * malformed, the flag reads as enabled so an unreachable flag service cannot\n * silently drop a benefit the user pays for.\n */\nexport const SUBSCRIPTION_FEE_WAIVER_FLAG = 'perpsSubscriptionFeeWaiverEnabled';\n\n/**\n * Terminal API configuration.\n * The full endpoint URL is injected at runtime via\n * `PerpsPlatformDependencies.terminalApi.marketDataUrl` from each client build\n * (dev/uat/prd); only cache settings live here.\n */\nexport const TERMINAL_API_CONFIG = {\n CacheTtlMs: 5 * 60 * 1000, // 5 minutes\n FetchTimeoutMs: 10_000, // 10 seconds – degrade to provider on slow Terminal\n} as const;\n\n/**\n * Decimal precision configuration\n * Controls maximum decimal places for price and input validation\n */\nexport const DECIMAL_PRECISION_CONFIG = {\n // Maximum decimal places for price input (matches Hyperliquid limit)\n // Used in TP/SL forms, limit price inputs, and price validation\n MaxPriceDecimals: 6,\n // Maximum significant figures allowed by HyperLiquid API\n // Orders with more than 5 significant figures will be rejected\n MaxSignificantFigures: 5,\n // Defensive fallback for size decimals when market data fails to load\n // Real szDecimals should always come from market data API (varies by asset)\n // Using 6 as safe maximum to prevent crashes (covers most assets)\n // NOTE: This is NOT semantically correct - just a defensive measure\n FallbackSizeDecimals: 6,\n} as const;\n\n/**\n * Decimal places kept by the shared TP/SL calculations.\n *\n * A calculated trigger price keeps the decimals of the first band whose\n * `BelowPrice` it is under, else `TriggerPriceDefaultDecimals`, without\n * trailing zeros: low-priced assets need more decimals. The provider rounds\n * the price to the asset's submission precision when the order is sent.\n */\nexport const TP_SL_PRECISION_CONFIG = {\n TriggerPriceBands: [\n { BelowPrice: 0.01, Decimals: 8 },\n { BelowPrice: 1, Decimals: DECIMAL_PRECISION_CONFIG.MaxPriceDecimals },\n { BelowPrice: 100, Decimals: 4 },\n ],\n TriggerPriceDefaultDecimals: 2,\n // Decimal places of a calculated or displayed RoE or price-move percentage\n PercentageDecimals: 2,\n} as const;\n\n/**\n * Market sorting configuration\n * Controls sorting behavior and presets for the trending markets view\n */\nexport const MARKET_SORTING_CONFIG = {\n // Default sort settings\n DefaultSortOptionId: 'volume' as const,\n DefaultDirection: 'desc' as const,\n\n // Available sort fields (only includes fields supported by PerpsMarketData)\n SortFields: {\n Volume: 'volume',\n PriceChange: 'priceChange',\n OpenInterest: 'openInterest',\n FundingRate: 'fundingRate',\n } as const,\n\n // Sort button presets for filter chips (simplified buttons without direction)\n SortButtonPresets: [\n { field: 'volume', labelKey: 'perps.sort.volume' },\n { field: 'priceChange', labelKey: 'perps.sort.price_change' },\n { field: 'fundingRate', labelKey: 'perps.sort.funding_rate' },\n ] as const,\n\n // Sort options for the bottom sheet\n // All options support direction toggle (high-to-low / low-to-high)\n SortOptions: [\n {\n id: 'volume',\n labelKey: 'perps.sort.volume',\n field: 'volume',\n direction: 'desc',\n },\n {\n id: 'priceChange',\n labelKey: 'perps.sort.price_change',\n field: 'priceChange',\n direction: 'desc',\n },\n {\n id: 'openInterest',\n labelKey: 'perps.sort.open_interest',\n field: 'openInterest',\n direction: 'desc',\n },\n {\n id: 'fundingRate',\n labelKey: 'perps.sort.funding_rate',\n field: 'fundingRate',\n direction: 'desc',\n },\n ] as const,\n} as const;\n\n/**\n * Type for valid sort option IDs\n * Derived from SORT_OPTIONS to ensure type safety\n * Valid values: 'volume' | 'priceChange' | 'openInterest' | 'fundingRate'\n */\nexport type SortOptionId =\n (typeof MARKET_SORTING_CONFIG.SortOptions)[number]['id'];\n\n/**\n * Perps interface mode.\n *\n * `Lite` is the simplified default experience; `Pro` exposes the advanced\n * trading layout (chart, order book, inline order form).\n */\nexport enum PerpsMode {\n Lite = 'lite',\n Pro = 'pro',\n}\n\n/**\n * Side filter for the Pro Positions list (long/short/all).\n *\n * Independent of `ordersSideFilter`. Shared across markets via\n * `proLayoutPreferences.positionsSideFilter`.\n */\nexport type ProPositionsSideFilter = 'all' | 'long' | 'short';\n\n/**\n * Sort fields available on the Pro Positions list.\n */\nexport type ProPositionsSortField =\n | 'positionValue'\n | 'unrealizedPnl'\n | 'fundingRate';\n\n/**\n * Sort direction for the Pro Positions list.\n */\nexport type ProPositionsSortDirection = 'asc' | 'desc';\n\n/**\n * Side filter for the Pro Orders list (long/short/all).\n *\n * Independent of `positionsSideFilter`. Shared across markets via\n * `proLayoutPreferences.ordersSideFilter`.\n */\nexport type ProOrdersSideFilter = 'all' | 'long' | 'short';\n\n/**\n * Sort fields available on the Pro Orders list.\n */\nexport type ProOrdersSortField = 'orderValue' | 'size' | 'price' | 'time';\n\n/**\n * Sort direction for the Pro Orders list.\n */\nexport type ProOrdersSortDirection = 'asc' | 'desc';\n\n/**\n * Currency used by the Pro order-book size/total column.\n */\nexport type OrderBookListCurrency = 'base' | 'usd';\n\n/**\n * Value shown by the Pro order-book size/total column.\n */\nexport type OrderBookListMetric = 'size' | 'total';\n\n/**\n * Market-agnostic Pro order-book display preferences.\n */\nexport type OrderBookPreferences = {\n currency: OrderBookListCurrency;\n metric: OrderBookListMetric;\n};\n\n/**\n * Default Pro order-book display preferences.\n */\nexport const DEFAULT_ORDER_BOOK_PREFERENCES: OrderBookPreferences = {\n currency: 'usd',\n metric: 'total',\n};\n\n/**\n * Pro-mode layout preferences (network-independent).\n *\n * Flat object that persists across markets (unlike the per-market\n * `tradeConfigurations`). `chartExpanded` and the `*Position` fields are\n * reserved for future container-position UI. Positions and Orders each have\n * their own side filter and sort so they survive market navigation and app\n * restarts independently.\n */\nexport type ProLayoutPreferences = {\n orderBookExpanded: boolean;\n chartExpanded: boolean;\n orderBookPosition: 'left' | 'right';\n orderFormPosition: 'left' | 'right';\n positionsSideFilter: ProPositionsSideFilter;\n positionsSortField: ProPositionsSortField;\n positionsSortDirection: ProPositionsSortDirection;\n ordersSideFilter: ProOrdersSideFilter;\n ordersSortField: ProOrdersSortField;\n ordersSortDirection: ProOrdersSortDirection;\n};\n\n/**\n * Default pro-mode layout preferences.\n *\n * Shared by `getDefaultPerpsControllerState()`, the controller getter, and the\n * selector so callers always receive a fully-populated object even when the\n * persisted state predates this field.\n */\nexport const DEFAULT_PRO_LAYOUT_PREFERENCES: ProLayoutPreferences = {\n orderBookExpanded: false,\n chartExpanded: true,\n orderBookPosition: 'left',\n orderFormPosition: 'right',\n positionsSideFilter: 'all',\n positionsSortField: 'positionValue',\n positionsSortDirection: 'desc',\n ordersSideFilter: 'all',\n ordersSortField: 'time',\n ordersSortDirection: 'desc',\n};\n\n/**\n * Default Perps interface mode.\n */\nexport const DEFAULT_PERPS_MODE: PerpsMode = PerpsMode.Lite;\n\n/**\n * Default market-agnostic order type.\n */\nexport const DEFAULT_SELECTED_ORDER_TYPE = 'market' as const;\n\n/**\n * Funding rate display configuration\n * Controls how funding rates are formatted and displayed\n */\nexport const FUNDING_RATE_CONFIG = {\n // Number of decimal places to display for funding rates\n Decimals: 4,\n // Default display value when funding rate is zero or unavailable\n ZeroDisplay: '0.0000%',\n // Multiplier to convert decimal funding rate to percentage\n PercentageMultiplier: 100,\n} as const;\n\n/**\n * Decimal places shown for each displayed perps value, shared by Mobile,\n * Extension and Terminal. Pass one as the `decimals` option of the display\n * formatters (`formatPercentage`, `formatCrossMarginRatio`, `formatPnl`,\n * `formatPerpsFiat`, `formatFundingRate`, `formatFeeBps`,\n * `formatLiquidationDistance`, `formatPerpsCompact`,\n * `formatPerpsUsdInput`). Prices follow `PRICE_RANGES_UNIVERSAL` instead.\n */\nexport const PERPS_DISPLAY_PRECISION = {\n // Generic percentage, such as the 24h change: \"+5.25%\"\n Percentage: 2,\n // Cross margin account ratio and usage, from a 0..1 ratio: \"17.4%\", \"63%\"\n CrossMarginRatioPercent: 1,\n // Return on equity: \"+10.3%\"\n RoePercent: 1,\n // Profit and loss in USD: \"+$12.34\"\n Pnl: 2,\n // Fee amount in USD: \"$1.50\"\n Fee: 2,\n // Fee rate as a percentage: \"0.045%\"\n FeeRatePercent: 3,\n // Funding rate as a percentage: \"0.0125%\"\n FundingRatePercent: FUNDING_RATE_CONFIG.Decimals,\n // Estimated slippage of an order as a percentage: \"0.0021%\"\n SlippageEstimatePercent: 4,\n // Most decimals a displayed price may have (Hyperliquid limit)\n MaxPriceDecimals: DECIMAL_PRECISION_CONFIG.MaxPriceDecimals,\n // Most decimals of a fee in basis points: \"4.5 bps\", \"1.44 bps\"\n FeeBps: 2,\n // Distance from the liquidation price as a percentage: \"30.00%\"\n LiquidationDistancePercent: 2,\n // Most decimals of TWAP progress as a percentage: \"25%\", \"33.33%\"\n TwapProgressPercent: 2,\n // Most decimals of a typed USD amount: \"12.34\"\n UsdInput: 2,\n // Most digits of a typed USD amount, integer and fraction together\n UsdInputMaxDigits: 9,\n // Volume and open interest from $1M up, and below $1K: \"$1.23M\", \"$999.50\"\n VolumeCompact: 2,\n // Volume and open interest in thousands: \"$123K\"\n VolumeCompactThousands: 0,\n // Order book size and total from 1K up: \"$2.1K\", \"604.9K\"\n OrderBookCompact: 1,\n // Most decimals of an abbreviated order book price: \"$61.47K\"\n OrderBookAbbreviatedPriceMax: 3,\n // Distance of an order book depth level from the mid price as a\n // percentage: \"+0.0125%\"\n OrderBookDepthRangePercent: 4,\n // Most decimals of the depth chart zoom range as a percentage: \"0.00125\"\n OrderBookDepthZoomRangePercentMax: 5,\n // Most decimals of a TWAP sub-order's base-asset size: \"0.00012\"\n TwapSuborderSize: 5,\n} as const;\n\n/**\n * Provider configuration for multi-provider support\n */\nexport const PROVIDER_CONFIG = {\n /** Default perpetual DEX provider when no explicit selection exists */\n DefaultProvider: 'hyperliquid' as const,\n /**\n * Force Lighter to testnet only. Off: Lighter follows the global network\n * toggle — mainnet reads AND writes are enabled (the initial rollout\n * write gate was removed once the write path was validated end-to-end\n * on testnet). Flip on to pin Lighter to testnet regardless of the\n * global network toggle.\n */\n LIGHTER_TESTNET_ONLY: false,\n} as const;\n\n// Disk-backed cold-start cache keys and throttle interval.\n// The user-data key ends in _V2 because the AccountState balance contract\n// changed (TAT-3047) and has no in-payload version field. Bumping the key\n// forces a one-time empty cache on upgrade — consumers fall through to\n// skeleton/fallback until the first WS tick, avoiding stale legacy-shape\n// reads that would surface as $0 balances.\nexport const PERPS_DISK_CACHE_MARKETS = 'PERPS_DISK_CACHE_MARKETS';\nexport const PERPS_DISK_CACHE_USER_DATA = 'PERPS_DISK_CACHE_USER_DATA_V2';\nexport const PERPS_DISK_CACHE_THROTTLE_MS = 30_000;\n\n/**\n * Minimum interval between WebSocket-triggered HL `userAbstraction`\n * refreshes. Balances picking up HL-web mode flips (Unified ↔ Standard)\n * promptly against burning REST quota on every spot tick. Covers the\n * observed user pattern of flipping mode once per session at most.\n */\nexport const ABSTRACTION_MODE_REFRESH_THROTTLE_MS = 60_000;\n\n/**\n * Build the standard provider:network cache key from controller state.\n *\n * @param state - Controller state containing provider and network info.\n * @param state.activeProvider - Active perps provider name.\n * @param state.isTestnet - Whether testnet mode is active.\n * @returns Cache key in the format \"provider:mainnet\" or \"provider:testnet\".\n */\nexport function getProviderNetworkKey(state: {\n activeProvider?: string;\n isTestnet?: boolean;\n}): string {\n return `${state.activeProvider ?? PROVIDER_CONFIG.DefaultProvider}:${state.isTestnet ? 'testnet' : 'mainnet'}`;\n}\n\n/**\n * Build a provider:network cache key for a specific provider id.\n * Accounts for LIGHTER_TESTNET_ONLY: when set, Lighter stays on testnet\n * regardless of the global network flag.\n *\n * @param providerId - The provider identifier (e.g. \"hyperliquid\", \"lighter\").\n * @param isTestnet - Global testnet flag from controller state.\n * @returns Cache key in the format \"provider:mainnet\" or \"provider:testnet\".\n */\nexport function buildProviderCacheKey(\n providerId: string,\n isTestnet: boolean,\n): string {\n let effectiveTestnet = isTestnet;\n if (providerId === 'lighter') {\n effectiveTestnet = PROVIDER_CONFIG.LIGHTER_TESTNET_ONLY || isTestnet;\n }\n return `${providerId}:${effectiveTestnet ? 'testnet' : 'mainnet'}`;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export type { PerpsControllerApproveSubscriptionBuilderFeeAction, PerpsControlle
32
32
  export { HyperLiquidProvider } from './providers/HyperLiquidProvider.js';
33
33
  export { ChaseOrderSuspensionError } from './providers/AggregatedPerpsProvider.js';
34
34
  export { WebSocketConnectionState, PerpsAnalyticsEvent, MARKET_CATEGORIES, MarketCategory, } from './types/index.js';
35
- export type { RawLedgerUpdate, UserHistoryItem, GetUserHistoryParams, TradeConfiguration, OrderType, TriggerOrderType, StrategyOrderType, OrdinaryOrderType, OrderExecution, TriggerDirection, TpslLinkage, PositionTriggerOrder, MarketType, MarketTypeFilter, InputMethod, TradeAction, TrackingData, TPSLTrackingData, OrderParams, ExpectedScaleLadder, MarginMode, OrderResult, PositionProtectionReceipt, LighterCredentials, OrderEditObservation, AttachedOrderGroup, ScaleOrderChild, ChaseOrder, GetChaseOrderOwnershipParams, ReconcileChaseOrderCancellationParams, ReconcileChaseOrderCancellationResult, PerpsChaseOrderOwner, PerpsChaseOrderDispatch, PerpsChaseOrderChild, PerpsChaseOrderOwnership, ChaseOrderMaxDistanceReached, ChaseOrderStatus, TwapOrder, TwapOrderFill, TwapOrderStatus, PerpsPendingManualRecovery, PerpsRecoveredDispatch, PerpsRecoveryVenueReview, ScaleOrderGroup, ResolveRecoveryProtectionParams, PerpsRecoveryProtectionResult, Position, AccountState, CrossMarginSummary, ClosePositionParams, ClosePositionsParams, ClosePositionsResult, UpdateMarginParams, MarginResult, FlipPositionParams, InitializeResult, ReadyToTradeResult, DisconnectResult, MarketInfo, PerpsMarketData, ToggleTestnetResult, AssetRoute, SwitchProviderResult, SetDefaultProviderResult, PerpsPendingTradeConfiguration, PerpsTradeConfiguration, PerpsProviderTradeConfigurations, CancelOrderParams, CancelOrderResult, BatchCancelOrdersParams, CancelOrdersParams, CancelOrdersResult, EditOrderParams, DepositParams, DepositWithConfirmationParams, DepositResult, DepositStatus, DepositFlowType, DepositStepInfo, WithdrawParams, WithdrawResult, TransferBetweenDexsParams, TransferBetweenDexsResult, GetHistoricalPortfolioParams, HistoricalPortfolioResult, LiveDataConfig, PerpsControllerConfig, PriceUpdate, OrderFill, CheckEligibilityParams, GetPositionsParams, GetAccountStateParams, GetUserDataSnapshotParams, PerpsUserDataSnapshot, GetOrderFillsParams, GetOrFetchFillsParams, GetOrdersParams, GetFundingParams, GetSupportedPathsParams, GetAvailableDexsParams, GetMarketsParams, GetMarketDataWithPricesParams, SortField, SortDirection, SubscribePricesParams, SubscribePositionsParams, SubscribeOrderFillsParams, SubscribeOrdersParams, SubscribeTwapOrdersParams, SubscribeAvailableToTradeParams, PerpsAvailableToTrade, SubscribeAccountParams, SubscribeOICapsParams, SubscribeCandlesParams, OrderBookLevel, OrderBookData, SubscribeOrderBookParams, PublicTrade, GetPublicTradesParams, SubscribePublicTradesParams, SubscribeProviderHealthParams, PerpsProviderHealth, PerpsProviderHealthReason, LiquidationPriceParams, MaintenanceMarginParams, PositionModifyPreviewParams, PositionModifyPreviewResult, PositionModifyPreviewSource, PositionModifyPreviewKind, PositionPreviewValue, PositionModifyPreviewCurrent, PositionModifyPreviewOpen, PositionModifyPreviewFullClose, PositionModifyPreviewUnsupported, PositionModifyPreviewNone, FeeCalculationParams, FeeCalculationResult, GetAccountSupportParams, PerpsAccountSupport, PerpsAccountUnsupportedReason, GetOrderCapabilitiesParams, GetMarginModeLockParams, MarginModeLockReason, MarginModeLockUnavailableReason, PerpsMarginModeLock, GetScalePriceLadderParams, OrderCapabilitiesUnavailableReason, DirectProviderOrderCapabilitiesUnavailableReason, RoutedOrderCapabilitiesUnavailableReason, DirectProviderScalePriceLadderUnavailableReason, ScalePriceLadderUnavailableReason, DirectProviderOrderCapabilities, PerpsOrderCapabilities, PerpsScalePriceLadder, PerpsSubscriptionBenefits, PerpsSubscriptionUsage, PerpsSubscriptionFeeWaiverStatus, PerpsFeeSource, PerpsFeeResolverScope, PerpsFeeResolution, PerpsTradingFeeGrant, UpdatePositionTPSLParams, PositionTPSLLeg, ReplacePositionTPSLLegParams, Order, Funding, PerpsProvider, PerpsProviderType, PerpsActiveProviderMode, AggregationMode, RoutingStrategy, AggregatedProviderConfig, ProviderError, AggregatedAccountState, PerpsLogger, PerpsTraceName, PerpsTraceValue, PerpsAnalyticsProperties, PerpsAttributionContext, PerpsMetrics, PerpsDebugLogger, PerpsStreamManager, PerpsPerformance, PerpsTracer, PerpsTypedMessageParams, PerpsTypedDataPayload, PerpsAccountSigner, PerpsAgentAccount, PerpsAgentSigner, PerpsTransactionParams, PerpsAddTransactionOptions, PerpsInternalAccount, PerpsRemoteFeatureFlagState, PerpsPlatformDependencies, PerpsTerminalMarketService, PerpsGlobalSnapshotRequest, PerpsGlobalSnapshotResult, TerminalAssetMetadata, PerpsCacheType, InvalidateCacheParams, PerpsCacheInvalidator, MarketDataFormatters, PaymentToken, PerpsSelectedPaymentToken, VersionGatedFeatureFlag, } from './types/index.js';
35
+ export type { RawLedgerUpdate, UserHistoryItem, GetUserHistoryParams, TradeConfiguration, OrderType, TriggerOrderType, StrategyOrderType, OrdinaryOrderType, OrderExecution, TriggerDirection, TpslLinkage, PositionTriggerOrder, MarketType, MarketTypeFilter, InputMethod, TradeAction, TrackingData, TPSLTrackingData, OrderParams, ExpectedScaleLadder, MarginMode, OrderResult, PositionProtectionReceipt, LighterCredentials, OrderEditObservation, AttachedOrderGroup, ScaleOrderChild, ChaseOrder, GetChaseOrderOwnershipParams, ReconcileChaseOrderCancellationParams, ReconcileChaseOrderCancellationResult, PerpsChaseOrderOwner, PerpsChaseOrderDispatch, PerpsChaseOrderChild, PerpsChaseOrderOwnership, ChaseOrderMaxDistanceReached, ChaseOrderStatus, TwapOrder, TwapOrderFill, TwapOrderStatus, PerpsPendingManualRecovery, PerpsRecoveredDispatch, PerpsRecoveryVenueReview, ScaleOrderGroup, ResolveRecoveryProtectionParams, PerpsRecoveryProtectionResult, Position, AccountState, CrossMarginSummary, HyperLiquidAbstractionMode, ClosePositionParams, ClosePositionsParams, ClosePositionsResult, UpdateMarginParams, MarginResult, FlipPositionParams, InitializeResult, ReadyToTradeResult, DisconnectResult, MarketInfo, PerpsMarketData, ToggleTestnetResult, AssetRoute, SwitchProviderResult, SetDefaultProviderResult, PerpsPendingTradeConfiguration, PerpsTradeConfiguration, PerpsProviderTradeConfigurations, CancelOrderParams, CancelOrderResult, BatchCancelOrdersParams, CancelOrdersParams, CancelOrdersResult, EditOrderParams, DepositParams, DepositWithConfirmationParams, DepositResult, DepositStatus, DepositFlowType, DepositStepInfo, WithdrawParams, WithdrawResult, TransferBetweenDexsParams, TransferBetweenDexsResult, GetHistoricalPortfolioParams, HistoricalPortfolioResult, LiveDataConfig, PerpsControllerConfig, PriceUpdate, OrderFill, CheckEligibilityParams, GetPositionsParams, GetAccountStateParams, GetUserDataSnapshotParams, PerpsUserDataSnapshot, GetOrderFillsParams, GetOrFetchFillsParams, GetOrdersParams, GetFundingParams, GetSupportedPathsParams, GetAvailableDexsParams, GetMarketsParams, GetMarketDataWithPricesParams, SortField, SortDirection, SubscribePricesParams, SubscribePositionsParams, SubscribeOrderFillsParams, SubscribeOrdersParams, SubscribeTwapOrdersParams, SubscribeAvailableToTradeParams, PerpsAvailableToTrade, SubscribeAccountParams, SubscribeOICapsParams, SubscribeCandlesParams, OrderBookLevel, OrderBookData, SubscribeOrderBookParams, PublicTrade, GetPublicTradesParams, SubscribePublicTradesParams, SubscribeProviderHealthParams, PerpsProviderHealth, PerpsProviderHealthReason, LiquidationPriceParams, MaintenanceMarginParams, PositionModifyPreviewParams, PositionModifyPreviewResult, PositionModifyPreviewSource, PositionModifyPreviewKind, PositionPreviewValue, PositionModifyPreviewCurrent, PositionModifyPreviewOpen, PositionModifyPreviewFullClose, PositionModifyPreviewUnsupported, PositionModifyPreviewNone, FeeCalculationParams, FeeCalculationResult, GetAccountSupportParams, PerpsAccountSupport, PerpsAccountUnsupportedReason, GetOrderCapabilitiesParams, GetMarginModeLockParams, MarginModeLockReason, MarginModeLockUnavailableReason, PerpsMarginModeLock, GetScalePriceLadderParams, OrderCapabilitiesUnavailableReason, DirectProviderOrderCapabilitiesUnavailableReason, RoutedOrderCapabilitiesUnavailableReason, DirectProviderScalePriceLadderUnavailableReason, ScalePriceLadderUnavailableReason, DirectProviderOrderCapabilities, PerpsOrderCapabilities, PerpsScalePriceLadder, PerpsSubscriptionBenefits, PerpsSubscriptionUsage, PerpsSubscriptionFeeWaiverStatus, PerpsFeeSource, PerpsFeeResolverScope, PerpsFeeResolution, PerpsTradingFeeGrant, UpdatePositionTPSLParams, PositionTPSLLeg, ReplacePositionTPSLLegParams, Order, Funding, PerpsProvider, PerpsProviderType, PerpsActiveProviderMode, AggregationMode, RoutingStrategy, AggregatedProviderConfig, ProviderError, AggregatedAccountState, PerpsLogger, PerpsTraceName, PerpsTraceValue, PerpsAnalyticsProperties, PerpsAttributionContext, PerpsMetrics, PerpsDebugLogger, PerpsStreamManager, PerpsPerformance, PerpsTracer, PerpsTypedMessageParams, PerpsTypedDataPayload, PerpsAccountSigner, PerpsAgentAccount, PerpsAgentSigner, PerpsTransactionParams, PerpsAddTransactionOptions, PerpsInternalAccount, PerpsRemoteFeatureFlagState, PerpsPlatformDependencies, PerpsTerminalMarketService, PerpsGlobalSnapshotRequest, PerpsGlobalSnapshotResult, TerminalAssetMetadata, PerpsCacheType, InvalidateCacheParams, PerpsCacheInvalidator, MarketDataFormatters, PaymentToken, PerpsSelectedPaymentToken, VersionGatedFeatureFlag, } from './types/index.js';
36
36
  export { PerpsTraceNames, PerpsTraceOperations, isVersionGatedFeatureFlag, } from './types/index.js';
37
37
  export type { TestResultStatus, TestResult, SDKTestType, HyperliquidAsset, CandleStick, CandleData, OrderFormState, OrderDirection, ReconnectOptions, ExtendedAssetMeta, ExtendedPerpDex, } from './types/index.js';
38
38
  export type { BaseTransactionResult, LastTransactionResult, TransactionStatus, TransactionRecord, } from './types/index.js';
@@ -52,10 +52,10 @@ export { LIGHTER_MAINNET_CHAIN_ID, LIGHTER_TESTNET_CHAIN_ID, getLighterChainId,
52
52
  export type { LighterNetwork, LighterCreateClientParams, LighterSignerBridge, LighterWebSocketCtor, LighterWebSocketLike, LighterWasmCall, LighterSignModifyOrderWireParams, LighterAuthConfig, } from './types/lighter-types.js';
53
53
  export { PERPS_CONSTANTS, WITHDRAWAL_CONSTANTS, VALIDATION_THRESHOLDS, ORDER_SLIPPAGE_CONFIG, CHASE_ORDER_CONFIG, CHASE_ORDER_STATUS, MAX_SLIPPAGE_BOUNDS, PERFORMANCE_CONFIG, TP_SL_CONFIG, HYPERLIQUID_ORDER_LIMITS, HYPERLIQUID_TWAP_LIMITS, CLOSE_POSITION_CONFIG, MARGIN_ADJUSTMENT_CONFIG, DATA_LAKE_API_CONFIG, DECIMAL_PRECISION_CONFIG, TP_SL_PRECISION_CONFIG, MARKET_SORTING_CONFIG, PROVIDER_CONFIG, FUNDING_RATE_CONFIG, PERPS_DISPLAY_PRECISION, } from './constants/index.js';
54
54
  export type { SortOptionId } from './constants/index.js';
55
- export { findEvmAccount, getEvmAccountFromAccountGroup, getSelectedEvmAccount, calculateWeightedReturnOnEquity, aggregateAccountStates, getCrossCollateral, calculateAccountSummary, } from './utils/index.js';
55
+ export { findEvmAccount, getEvmAccountFromAccountGroup, getSelectedEvmAccount, calculateWeightedReturnOnEquity, aggregateAccountStates, getCrossCollateral, getCrossMarginSpotCollateral, calculateAccountSummary, } from './utils/index.js';
56
56
  export type { ReturnOnEquityInput, CrossMarginSummaryInput, PerpsAccountSummary, CalculateAccountSummaryParams, } from './utils/index.js';
57
- export { calculatePriceForRoE, calculateSignedRoEForPrice, calculateRoEForPrice, calculatePriceForPercentage, calculatePercentageForPrice, getMaxStopLossPercentage, isValidStopLossPercentage, isPositiveTriggerPrice, isValidTakeProfitPrice, isValidStopLossPrice, isStopLossSafeFromLiquidation, validateTPSLPrices, formatRoePercent, } from './utils/index.js';
58
- export type { TpslCalculationParams, TpslValidationResult, } from './utils/index.js';
57
+ export { calculatePriceForRoE, calculateSignedRoEForPrice, calculateRoEForPrice, calculatePriceForPercentage, calculatePercentageForPrice, getMaxStopLossPercentage, isValidStopLossPercentage, isPositiveTriggerPrice, isValidTakeProfitPrice, isValidStopLossPrice, isStopLossSafeFromLiquidation, validateTPSLPrices, formatRoePercent, calculateExpectedTriggerPnl, calculateMaxRemovableMargin, estimateLiquidationPriceAfterMarginChange, } from './utils/index.js';
58
+ export type { TpslCalculationParams, TpslValidationResult, ExpectedTriggerPnlParams, MaxRemovableMarginParams, LiquidationPriceAfterMarginChangeParams, } from './utils/index.js';
59
59
  export { estimateCloseReceive, calculateNetClosedPnl } from './utils/index.js';
60
60
  export type { CloseReceiveEstimateParams, CloseReceiveEstimate, NetClosedPnlParams, } from './utils/index.js';
61
61
  export { ensureError, isAbortError } from './utils/index.js';
@@ -88,8 +88,8 @@ export { adaptOrderToSDK, adaptPositionFromSDK, adaptOrderFromSDK, adaptMarketFr
88
88
  export { previewHyperLiquidIsolatedPositionModify, resolveHyperLiquidMarginTiers, buildMaintenanceSchedule, estimateIsolatedLiquidationPrice, estimateIsolatedLiquidationPriceAtTier, estimateIsolatedLeverageChange, } from './utils/index.js';
89
89
  export type { HyperLiquidMarginTier, IsolatedLeverageChangeParams, IsolatedLeverageChange, } from './utils/index.js';
90
90
  export { getEnvironment } from './utils/index.js';
91
- export type { FiatRangeConfig, PerpsCompactField, PerpsCompactFormatOptions, PerpsDisplayFormatOptions, PerpsFiatFormatOptions, PerpsFundingRateFormatOptions, PerpsIntlFormatters, PerpsOrderBookLadderOptions, PerpsOrderBookPriceFormat, PerpsOrderBookPriceFormatOptions, PerpsPercentageFormatOptions, PerpsSignDisplay, PerpsUsdInput, PerpsUsdInputFormatOptions, } from './utils/index.js';
92
- export { PRICE_THRESHOLD, formatWithSignificantDigits, PRICE_RANGES_MINIMAL_VIEW, PRICE_RANGES_UNIVERSAL, formatPerpsFiat, formatPositionSize, formatPnl, formatPercentage, formatFundingRate, formatFeeBps, formatLiquidationDistance, formatPerpsCompact, getPerpsOrderBookPriceFormat, formatPerpsOrderBookPrice, formatPerpsUsdInput, } from './utils/index.js';
91
+ export type { FiatRangeConfig, PerpsCompactField, PerpsCompactFormatOptions, PerpsDisplayFormatOptions, PerpsFiatFormatOptions, PerpsFundingDirection, PerpsFundingRateFormatOptions, PerpsIntlFormatters, PerpsOrderBookLadderOptions, PerpsOrderBookPriceFormat, PerpsOrderBookPriceFormatOptions, PerpsPercentageFormatOptions, PerpsSignDisplay, PerpsUsdInput, PerpsUsdInputFormatOptions, } from './utils/index.js';
92
+ export { PRICE_THRESHOLD, formatWithSignificantDigits, PRICE_RANGES_MINIMAL_VIEW, PRICE_RANGES_UNIVERSAL, formatPerpsFiat, formatPositionSize, formatPnl, formatPercentage, formatCrossMarginRatio, formatFundingRate, formatPositionFunding, getPositionFundingDirection, formatFundingPayment, formatFeeBps, formatLiquidationDistance, formatPerpsCompact, getPerpsOrderBookPriceFormat, formatPerpsOrderBookPrice, formatPerpsUsdInput, } from './utils/index.js';
93
93
  export { isPerpsErrorCode, PERPS_ERROR_CODES } from './perpsErrorCodes.js';
94
94
  export type { PerpsErrorCode } from './perpsErrorCodes.js';
95
95
  export type { PerpsErrorDetails, PriceMovedErrorDetails } from './errors.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EACL,eAAe,EACf,8BAA8B,EAC9B,mBAAmB,EACnB,SAAS,EACT,8BAA8B,EAC9B,kBAAkB,EAClB,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,gDAAgD,EAChD,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,kDAAkD,EAClD,kCAAkC,EAClC,8CAA8C,EAC9C,+CAA+C,EAC/C,0CAA0C,EAC1C,g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gBAAgB,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,6CAA6C,CAAC;AACrD,YAAY,EACV,yBAAyB,EACzB,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,6CAA6C,CAAC"}
package/dist/index.js CHANGED
@@ -45,8 +45,8 @@ export { PerpsMeasurementName } from './constants/index.js';
45
45
  export { LIGHTER_MAINNET_CHAIN_ID, LIGHTER_TESTNET_CHAIN_ID, getLighterChainId, LIGHTER_ENDPOINTS, getLighterHttpEndpoint, LIGHTER_DEFAULT_API_KEY_INDEX, LIGHTER_HTTP_TIMEOUT_MS, LIGHTER_PRICE_POLLING_INTERVAL_MS, LIGHTER_MAX_LEVERAGE, toLighterInteger, fromLighterInteger, computeLighterMinOrderSize, } from './constants/index.js';
46
46
  export { PERPS_CONSTANTS, WITHDRAWAL_CONSTANTS, VALIDATION_THRESHOLDS, ORDER_SLIPPAGE_CONFIG, CHASE_ORDER_CONFIG, CHASE_ORDER_STATUS, MAX_SLIPPAGE_BOUNDS, PERFORMANCE_CONFIG, TP_SL_CONFIG, HYPERLIQUID_ORDER_LIMITS, HYPERLIQUID_TWAP_LIMITS, CLOSE_POSITION_CONFIG, MARGIN_ADJUSTMENT_CONFIG, DATA_LAKE_API_CONFIG, DECIMAL_PRECISION_CONFIG, TP_SL_PRECISION_CONFIG, MARKET_SORTING_CONFIG, PROVIDER_CONFIG, FUNDING_RATE_CONFIG, PERPS_DISPLAY_PRECISION, } from './constants/index.js';
47
47
  // Utilities (explicit named exports)
48
- export { findEvmAccount, getEvmAccountFromAccountGroup, getSelectedEvmAccount, calculateWeightedReturnOnEquity, aggregateAccountStates, getCrossCollateral, calculateAccountSummary, } from './utils/index.js';
49
- export { calculatePriceForRoE, calculateSignedRoEForPrice, calculateRoEForPrice, calculatePriceForPercentage, calculatePercentageForPrice, getMaxStopLossPercentage, isValidStopLossPercentage, isPositiveTriggerPrice, isValidTakeProfitPrice, isValidStopLossPrice, isStopLossSafeFromLiquidation, validateTPSLPrices, formatRoePercent, } from './utils/index.js';
48
+ export { findEvmAccount, getEvmAccountFromAccountGroup, getSelectedEvmAccount, calculateWeightedReturnOnEquity, aggregateAccountStates, getCrossCollateral, getCrossMarginSpotCollateral, calculateAccountSummary, } from './utils/index.js';
49
+ export { calculatePriceForRoE, calculateSignedRoEForPrice, calculateRoEForPrice, calculatePriceForPercentage, calculatePercentageForPrice, getMaxStopLossPercentage, isValidStopLossPercentage, isPositiveTriggerPrice, isValidTakeProfitPrice, isValidStopLossPrice, isStopLossSafeFromLiquidation, validateTPSLPrices, formatRoePercent, calculateExpectedTriggerPnl, calculateMaxRemovableMargin, estimateLiquidationPriceAfterMarginChange, } from './utils/index.js';
50
50
  export { estimateCloseReceive, calculateNetClosedPnl } from './utils/index.js';
51
51
  export { ensureError, isAbortError } from './utils/index.js';
52
52
  export { processL2BookData, processBboData } from './utils/index.js';
@@ -69,7 +69,7 @@ export { wait } from './utils/index.js';
69
69
  export { adaptOrderToSDK, adaptPositionFromSDK, adaptOrderFromSDK, adaptMarketFromSDK, adaptAccountStateFromSDK, buildAssetMapping, formatHyperLiquidPrice, formatHyperLiquidSize, calculateHip3AssetId, parseAssetName, adaptHyperLiquidLedgerUpdateToUserHistoryItem, } from './utils/index.js';
70
70
  export { previewHyperLiquidIsolatedPositionModify, resolveHyperLiquidMarginTiers, buildMaintenanceSchedule, estimateIsolatedLiquidationPrice, estimateIsolatedLiquidationPriceAtTier, estimateIsolatedLeverageChange, } from './utils/index.js';
71
71
  export { getEnvironment } from './utils/index.js';
72
- export { PRICE_THRESHOLD, formatWithSignificantDigits, PRICE_RANGES_MINIMAL_VIEW, PRICE_RANGES_UNIVERSAL, formatPerpsFiat, formatPositionSize, formatPnl, formatPercentage, formatFundingRate, formatFeeBps, formatLiquidationDistance, formatPerpsCompact, getPerpsOrderBookPriceFormat, formatPerpsOrderBookPrice, formatPerpsUsdInput, } from './utils/index.js';
72
+ export { PRICE_THRESHOLD, formatWithSignificantDigits, PRICE_RANGES_MINIMAL_VIEW, PRICE_RANGES_UNIVERSAL, formatPerpsFiat, formatPositionSize, formatPnl, formatPercentage, formatCrossMarginRatio, formatFundingRate, formatPositionFunding, getPositionFundingDirection, formatFundingPayment, formatFeeBps, formatLiquidationDistance, formatPerpsCompact, getPerpsOrderBookPriceFormat, formatPerpsOrderBookPrice, formatPerpsUsdInput, } from './utils/index.js';
73
73
  // Error codes (explicit named exports)
74
74
  export { isPerpsErrorCode, PERPS_ERROR_CODES } from './perpsErrorCodes.js';
75
75
  // Selectors (explicit named exports)