@metamask-previews/perps-controller 9.2.1-preview-75ce9748b → 9.2.1-preview-5cac90a
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.
- package/CHANGELOG.md +11 -0
- package/dist/constants/eventNames.cjs +1 -0
- package/dist/constants/eventNames.cjs.map +1 -1
- package/dist/constants/eventNames.d.cts +1 -0
- package/dist/constants/eventNames.d.cts.map +1 -1
- package/dist/constants/eventNames.d.mts +1 -0
- package/dist/constants/eventNames.d.mts.map +1 -1
- package/dist/constants/eventNames.mjs +1 -0
- package/dist/constants/eventNames.mjs.map +1 -1
- package/dist/providers/HyperLiquidProvider.cjs +7 -0
- package/dist/providers/HyperLiquidProvider.cjs.map +1 -1
- package/dist/providers/HyperLiquidProvider.d.cts.map +1 -1
- package/dist/providers/HyperLiquidProvider.d.mts.map +1 -1
- package/dist/providers/HyperLiquidProvider.mjs +7 -0
- package/dist/providers/HyperLiquidProvider.mjs.map +1 -1
- package/dist/services/HyperLiquidClientService.cjs +1 -1
- package/dist/services/HyperLiquidClientService.cjs.map +1 -1
- package/dist/services/TradingService.cjs +66 -3
- package/dist/services/TradingService.cjs.map +1 -1
- package/dist/services/TradingService.d.cts.map +1 -1
- package/dist/services/TradingService.d.mts.map +1 -1
- package/dist/services/TradingService.mjs +66 -3
- package/dist/services/TradingService.mjs.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs.map +1 -1
- package/dist/utils/standaloneInfoClient.cjs +1 -1
- package/dist/utils/standaloneInfoClient.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TradingService.d.cts","sourceRoot":"","sources":["../../src/services/TradingService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TradingService.d.cts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C;;;;;;;;;OASG;IACG,kBAAkB,CAAC,OAAO,EAAE;QAChC,QAAQ,EAAE,aAAa,CAAC;QACxB,MAAM,EAAE,wBAAwB,CAAC;QACjC,OAAO,EAAE,cAAc,CAAC;KACzB,GAAG,OAAO,CAAC,WAAW,CAAC;IAiKxB;;;;;;;;;OASG;IACG,YAAY,CAAC,OAAO,EAAE;QAC1B,QAAQ,EAAE,aAAa,CAAC;QACxB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,cAAc,CAAC;KACzB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAqGjD;;;;;;;;;OASG;IACG,YAAY,CAAC,OAAO,EAAE;QAC1B,QAAQ,EAAE,aAAa,CAAC;QACxB,QAAQ,EAAE,QAAQ,CAAC;QACnB,YAAY,CAAC,EAAE,YAAY,CAAC;QAC5B,OAAO,EAAE,cAAc,CAAC;KACzB,GAAG,OAAO,CAAC,WAAW,CAAC;CA8KzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TradingService.d.mts","sourceRoot":"","sources":["../../src/services/TradingService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TradingService.d.mts","sourceRoot":"","sources":["../../src/services/TradingService.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,wBAAwB,EAExB,yBAAyB,EAC1B,2BAAiB;AAElB,OAAO,KAAK,EAAE,yBAAyB,EAAE,wCAAoC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,6BAAyB;AAEvD;;;GAGG;AACH,MAAM,MAAM,4BAA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C,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAqGjD;;;;;;;;;OASG;IACG,YAAY,CAAC,OAAO,EAAE;QAC1B,QAAQ,EAAE,aAAa,CAAC;QACxB,QAAQ,EAAE,QAAQ,CAAC;QACnB,YAAY,CAAC,EAAE,YAAY,CAAC;QAC5B,OAAO,EAAE,cAAc,CAAC;KACzB,GAAG,OAAO,CAAC,WAAW,CAAC;CA8KzB"}
|
|
@@ -10,6 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _TradingService_instances, _TradingService_deps, _TradingService_controllerDeps, _TradingService_getErrorContext, _TradingService_buildAttributionProperties, _TradingService_trackSubmitted, _TradingService_trackOrderResult, _TradingService_handleOrderSuccess, _TradingService_withFeeDiscount, _TradingService_loadPositionData, _TradingService_calculateCloseMetrics, _TradingService_buildCloseEventProperties, _TradingService_trackPositionCloseResult, _TradingService_handleDataLakeReporting, _TradingService_calculateFeeDiscountWithMeasurement;
|
|
13
|
+
import { BigNumber } from "bignumber.js";
|
|
13
14
|
import { v4 as uuidv4 } from "uuid";
|
|
14
15
|
import { PERPS_EVENT_PROPERTY, PERPS_EVENT_VALUE } from "../constants/eventNames.mjs";
|
|
15
16
|
import { isTPSLOrder } from "../constants/orderTypes.mjs";
|
|
@@ -901,6 +902,7 @@ export class TradingService {
|
|
|
901
902
|
: PERPS_EVENT_VALUE.STATUS.FAILED,
|
|
902
903
|
[PERPS_EVENT_PROPERTY.COMPLETION_DURATION]: completionDuration,
|
|
903
904
|
[PERPS_EVENT_PROPERTY.BULK_ACTION_ID]: bulkActionId,
|
|
905
|
+
[PERPS_EVENT_PROPERTY.NUMBER_POSITIONS_CLOSED]: operationResult?.successCount ?? 0,
|
|
904
906
|
};
|
|
905
907
|
if (operationError) {
|
|
906
908
|
batchCloseProps[PERPS_EVENT_PROPERTY.ERROR_MESSAGE] =
|
|
@@ -1116,6 +1118,19 @@ export class TradingService {
|
|
|
1116
1118
|
__classPrivateFieldGet(this, _TradingService_deps, "f").cacheInvalidator.invalidate({ cacheType: 'positions' });
|
|
1117
1119
|
__classPrivateFieldGet(this, _TradingService_deps, "f").cacheInvalidator.invalidate({ cacheType: 'accountState' });
|
|
1118
1120
|
}
|
|
1121
|
+
else {
|
|
1122
|
+
// Track failure analytics for a non-throwing provider failure so the
|
|
1123
|
+
// terminal Risk Management event is emitted exactly once here (the
|
|
1124
|
+
// thrown path below handles exceptions).
|
|
1125
|
+
__classPrivateFieldGet(this, _TradingService_deps, "f").metrics.trackPerpsEvent(PerpsAnalyticsEvent.RiskManagement, {
|
|
1126
|
+
[PERPS_EVENT_PROPERTY.STATUS]: PERPS_EVENT_VALUE.STATUS.FAILED,
|
|
1127
|
+
[PERPS_EVENT_PROPERTY.ASSET]: symbol,
|
|
1128
|
+
[PERPS_EVENT_PROPERTY.ACTION]: parseFloat(amount) > 0 ? 'add_margin' : 'remove_margin',
|
|
1129
|
+
[PERPS_EVENT_PROPERTY.MARGIN_USED]: Math.abs(parseFloat(amount)),
|
|
1130
|
+
[PERPS_EVENT_PROPERTY.COMPLETION_DURATION]: completionDuration,
|
|
1131
|
+
[PERPS_EVENT_PROPERTY.ERROR_MESSAGE]: result.error ?? 'Unknown error',
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1119
1134
|
__classPrivateFieldGet(this, _TradingService_deps, "f").tracer.endTrace({
|
|
1120
1135
|
name: PerpsTraceNames.UpdateMargin,
|
|
1121
1136
|
id: traceId,
|
|
@@ -1438,6 +1453,44 @@ _TradingService_deps = new WeakMap(), _TradingService_controllerDeps = new WeakM
|
|
|
1438
1453
|
}
|
|
1439
1454
|
// Propagate discovery attribution + hl_fee_rate (TAT-3080, TAT-3149)
|
|
1440
1455
|
Object.assign(properties, __classPrivateFieldGet(this, _TradingService_instances, "m", _TradingService_buildAttributionProperties).call(this, params.trackingData));
|
|
1456
|
+
// Emit an additional partially filled trade event when the fill is partial,
|
|
1457
|
+
// mirroring the close path so the fill's partiality is visible in analytics
|
|
1458
|
+
// rather than hidden behind a status=executed event. Classification is based
|
|
1459
|
+
// on the provider's final submitted size (post precision rounding, USD
|
|
1460
|
+
// recalculation, and $10-minimum retry), not the caller's pre-normalization
|
|
1461
|
+
// params.size — the provider transforms the size before submission and a
|
|
1462
|
+
// complete fill of the normalized size must not look partial. When the
|
|
1463
|
+
// provider did not report a submitted size we do not classify (rather than
|
|
1464
|
+
// guess from params.size). The partial event mirrors the close schema:
|
|
1465
|
+
// order_size = submitted size, amount_filled = filled, remaining = the rest.
|
|
1466
|
+
// Compare and subtract the decimal size strings with arbitrary-precision
|
|
1467
|
+
// math (BigNumber): routing them through parseFloat can introduce
|
|
1468
|
+
// binary-float artifacts that collapse distinct values (misclassifying the
|
|
1469
|
+
// fill) or leave e-17 dust in remaining_amount. Only convert to Number for
|
|
1470
|
+
// the emitted analytics values, after the exact decimal subtraction.
|
|
1471
|
+
const submittedSize = result?.submittedSize === undefined
|
|
1472
|
+
? undefined
|
|
1473
|
+
: new BigNumber(result.submittedSize);
|
|
1474
|
+
const filledSize = result?.filledSize === undefined
|
|
1475
|
+
? undefined
|
|
1476
|
+
: new BigNumber(result.filledSize);
|
|
1477
|
+
if (result?.success === true &&
|
|
1478
|
+
submittedSize !== undefined &&
|
|
1479
|
+
filledSize !== undefined &&
|
|
1480
|
+
submittedSize.isFinite() &&
|
|
1481
|
+
filledSize.isFinite() &&
|
|
1482
|
+
filledSize.gt(0) &&
|
|
1483
|
+
filledSize.lt(submittedSize)) {
|
|
1484
|
+
__classPrivateFieldGet(this, _TradingService_deps, "f").metrics.trackPerpsEvent(PerpsAnalyticsEvent.TradeTransaction, {
|
|
1485
|
+
...properties,
|
|
1486
|
+
[PERPS_EVENT_PROPERTY.STATUS]: PERPS_EVENT_VALUE.STATUS.PARTIALLY_FILLED,
|
|
1487
|
+
[PERPS_EVENT_PROPERTY.ORDER_SIZE]: submittedSize.toNumber(),
|
|
1488
|
+
[PERPS_EVENT_PROPERTY.AMOUNT_FILLED]: filledSize.toNumber(),
|
|
1489
|
+
[PERPS_EVENT_PROPERTY.REMAINING_AMOUNT]: submittedSize
|
|
1490
|
+
.minus(filledSize)
|
|
1491
|
+
.toNumber(),
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1441
1494
|
__classPrivateFieldGet(this, _TradingService_deps, "f").metrics.trackPerpsEvent(PerpsAnalyticsEvent.TradeTransaction, properties);
|
|
1442
1495
|
}, _TradingService_handleOrderSuccess =
|
|
1443
1496
|
/**
|
|
@@ -1568,6 +1621,16 @@ async function _TradingService_loadPositionData(options) {
|
|
|
1568
1621
|
isPartiallyFilled,
|
|
1569
1622
|
};
|
|
1570
1623
|
}, _TradingService_buildCloseEventProperties = function _TradingService_buildCloseEventProperties(position, params, metrics, result, status, error) {
|
|
1624
|
+
// Effective leverage = positionUSD / marginUSD, rounded to 1 decimal place.
|
|
1625
|
+
// Computed from the live position rather than the configured leverage so it's
|
|
1626
|
+
// populated for every close, including TP/SL triggers.
|
|
1627
|
+
const positionUSD = Math.abs(parseFloat(position.positionValue));
|
|
1628
|
+
const marginUSD = parseFloat(position.marginUsed);
|
|
1629
|
+
const effectiveLeverage = Number.isFinite(positionUSD) &&
|
|
1630
|
+
Number.isFinite(marginUSD) &&
|
|
1631
|
+
marginUSD > 0
|
|
1632
|
+
? Math.round((positionUSD / marginUSD) * 10) / 10
|
|
1633
|
+
: undefined;
|
|
1571
1634
|
const baseProperties = {
|
|
1572
1635
|
[PERPS_EVENT_PROPERTY.STATUS]: status,
|
|
1573
1636
|
[PERPS_EVENT_PROPERTY.ASSET]: position.symbol,
|
|
@@ -1618,9 +1681,9 @@ async function _TradingService_loadPositionData(options) {
|
|
|
1618
1681
|
...(params.trackingData?.vipDiscount !== undefined && {
|
|
1619
1682
|
[PERPS_EVENT_PROPERTY.VIP_DISCOUNT]: params.trackingData.vipDiscount,
|
|
1620
1683
|
}),
|
|
1621
|
-
//
|
|
1622
|
-
...(
|
|
1623
|
-
[PERPS_EVENT_PROPERTY.LEVERAGE]:
|
|
1684
|
+
// Effective leverage on close events
|
|
1685
|
+
...(effectiveLeverage !== undefined && {
|
|
1686
|
+
[PERPS_EVENT_PROPERTY.LEVERAGE]: effectiveLeverage,
|
|
1624
1687
|
}),
|
|
1625
1688
|
// Discovery attribution + hl_fee_rate (TAT-3080, TAT-3149)
|
|
1626
1689
|
...__classPrivateFieldGet(this, _TradingService_instances, "m", _TradingService_buildAttributionProperties).call(this, params.trackingData),
|