@pear-protocol/hyperliquid-sdk 0.0.7 → 0.0.8

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/dist/index.d.ts CHANGED
@@ -713,9 +713,9 @@ declare enum PositionSide {
713
713
  SHORT = "SHORT"
714
714
  }
715
715
  /**
716
- * Position calculation utility class
716
+ * Aggregate position calculation utility class that handles cross-position asset syncing
717
717
  */
718
- declare class PositionCalculator {
718
+ declare class AggregatePositionCalculator {
719
719
  private webData2;
720
720
  private allMids;
721
721
  constructor(webData2: WebData2Response | null, allMids: WsAllMidsData | null);
@@ -729,22 +729,27 @@ declare class PositionCalculator {
729
729
  getUserPositions(): AssetPosition[];
730
730
  /**
731
731
  * Calculate updated open positions by syncing platform positions with HyperLiquid data
732
+ * Uses aggregate totals across all positions for accurate cross-position sync
732
733
  */
733
734
  calculateOpenPositions(platformPositions: OpenPositionDto[]): OpenPositionDto[];
734
735
  /**
735
- * Sync a single position with HyperLiquid data
736
+ * Calculate total platform sizes per asset across all positions
736
737
  */
737
- private syncPositionWithHyperliquid;
738
+ private calculatePlatformTotalsByAsset;
738
739
  /**
739
- * Group assets by their base currency
740
+ * Extract base currency from asset name (handles "LINK/USD" -> "LINK")
740
741
  */
741
- private groupAssetsByBaseCurrency;
742
+ private extractBaseCurrency;
742
743
  /**
743
- * Sync a group of assets (same base currency) with HyperLiquid position data
744
+ * Sync a single position with HyperLiquid data using aggregate totals
744
745
  */
745
- private syncAssetGroupWithHyperliquid;
746
+ private syncPositionWithAggregateData;
746
747
  /**
747
- * Determine sync status based on asset sync results
748
+ * Sync individual asset with aggregate data awareness
749
+ */
750
+ private syncAssetWithAggregateData;
751
+ /**
752
+ * Determine sync status with sophisticated side-aware logic
748
753
  */
749
754
  private determineSyncStatus;
750
755
  /**
@@ -756,11 +761,11 @@ declare class PositionCalculator {
756
761
  */
757
762
  private mapSyncResultToAssetDto;
758
763
  /**
759
- * Calculate entry ratio (weighted long entry value / weighted short entry value)
764
+ * Calculate entry ratio using actual sizes from sync results
760
765
  */
761
766
  private calculateEntryRatio;
762
767
  /**
763
- * Calculate mark ratio (weighted long mark value / weighted short mark value)
768
+ * Calculate mark ratio using actual sizes and current prices
764
769
  */
765
770
  private calculateMarkRatio;
766
771
  /**
@@ -822,5 +827,5 @@ declare class AccountSummaryCalculator {
822
827
  hasRealTimeData(): boolean;
823
828
  }
824
829
 
825
- export { AccountSummaryCalculator, PearHyperliquidClient, PearHyperliquidProvider, PearMigrationSDK, PositionCalculator, PositionSide, PearHyperliquidClient as default, useAccountSummary, useAddress, useCalculatedAccountSummary, useCalculatedOpenPositions, useHyperliquidNativeWebSocket, useHyperliquidWebSocket, useMigrationSDK, useOpenOrders, useOpenPositions, usePearHyperliquidClient, useTradeHistories };
830
+ export { AccountSummaryCalculator, AggregatePositionCalculator, PearHyperliquidClient, PearHyperliquidProvider, PearMigrationSDK, PositionSide, PearHyperliquidClient as default, useAccountSummary, useAddress, useCalculatedAccountSummary, useCalculatedOpenPositions, useHyperliquidNativeWebSocket, useHyperliquidWebSocket, useMigrationSDK, useOpenOrders, useOpenPositions, usePearHyperliquidClient, useTradeHistories };
826
831
  export type { AccountSummaryResponseDto, AgentWalletDto, ApiErrorResponse, ApiResponse, AssetCtx, AssetInformationDetail, AssetPosition, BalanceSummaryDto, CrossMarginSummaryDto, CumFundingDto, MarginSummaryDto, MigrationHookState, MigrationHooks, OpenLimitOrderDto, OpenOrderV1Dto, OpenPositionDto, OpenPositionV1Dto, OrderAssetDto, OrderStatus, PaginatedTradeHistoryResponseDto, PearHyperliquidConfig, PnlDto, PositionAssetDetailDto, PositionSideDto, PositionSyncStatus, RawValueDto, SyncOpenOrderDto, SyncOpenOrderResponseDto, SyncOpenPositionDto, SyncOpenPositionResponseDto, SyncTradeHistoryDto, SyncTradeHistoryResponseDto, TpSlDto, TradeHistoryAssetDataDto, TradeHistoryDataDto, TradeHistoryV1Dto, UniverseAsset, WebData2Response, WebSocketChannel, WebSocketConnectionState, WebSocketDataMessage, WebSocketMessage, WebSocketResponse, WebSocketSubscribeMessage, WsAllMidsData };
package/dist/index.esm.js CHANGED
@@ -2958,9 +2958,9 @@ var PositionSide;
2958
2958
  PositionSide["SHORT"] = "SHORT";
2959
2959
  })(PositionSide || (PositionSide = {}));
2960
2960
  /**
2961
- * Position calculation utility class
2961
+ * Aggregate position calculation utility class that handles cross-position asset syncing
2962
2962
  */
2963
- class PositionCalculator {
2963
+ class AggregatePositionCalculator {
2964
2964
  constructor(webData2, allMids) {
2965
2965
  this.webData2 = webData2;
2966
2966
  this.allMids = allMids;
@@ -2983,7 +2983,7 @@ class PositionCalculator {
2983
2983
  if (basePrice) {
2984
2984
  return Number(basePrice);
2985
2985
  }
2986
- console.warn(`[PositionCalculator] No market price found for coin: ${coin}`);
2986
+ console.warn(`[AggregatePositionCalculator] No market price found for coin: ${coin}`);
2987
2987
  return 0;
2988
2988
  }
2989
2989
  /**
@@ -2995,19 +2995,16 @@ class PositionCalculator {
2995
2995
  }
2996
2996
  /**
2997
2997
  * Calculate updated open positions by syncing platform positions with HyperLiquid data
2998
+ * Uses aggregate totals across all positions for accurate cross-position sync
2998
2999
  */
2999
3000
  calculateOpenPositions(platformPositions) {
3000
3001
  if (!(platformPositions === null || platformPositions === void 0 ? void 0 : platformPositions.length)) {
3001
3002
  return [];
3002
3003
  }
3003
3004
  const hyperliquidPositions = this.getUserPositions();
3004
- return platformPositions.map(position => this.syncPositionWithHyperliquid(position, hyperliquidPositions));
3005
- }
3006
- /**
3007
- * Sync a single position with HyperLiquid data
3008
- */
3009
- syncPositionWithHyperliquid(position, hyperliquidPositions) {
3010
- // Create a map of HyperLiquid positions by coin for quick lookup
3005
+ // Build a map of total platform sizes per asset across ALL positions
3006
+ const platformTotalsByAsset = this.calculatePlatformTotalsByAsset(platformPositions);
3007
+ // Create a map of HyperLiquid positions by coin
3011
3008
  const hlPositionsMap = new Map();
3012
3009
  hyperliquidPositions.forEach(assetPos => {
3013
3010
  var _a;
@@ -3015,112 +3012,159 @@ class PositionCalculator {
3015
3012
  hlPositionsMap.set(assetPos.position.coin, assetPos);
3016
3013
  }
3017
3014
  });
3018
- // Combine all assets for processing
3019
- const allAssets = [
3020
- ...position.longAssets.map(asset => ({ ...asset, side: PositionSide.LONG })),
3021
- ...position.shortAssets.map(asset => ({ ...asset, side: PositionSide.SHORT }))
3022
- ];
3023
- // Group assets by base currency for multi-pair position handling
3024
- const assetsByBaseCurrency = this.groupAssetsByBaseCurrency(allAssets);
3025
- // Sync each asset group with HyperLiquid data
3026
- const syncResults = [];
3027
- for (const [baseCurrency, assets] of assetsByBaseCurrency.entries()) {
3028
- const hlPosition = hlPositionsMap.get(baseCurrency);
3029
- const groupSyncResults = this.syncAssetGroupWithHyperliquid(assets, hlPosition);
3030
- syncResults.push(...groupSyncResults);
3031
- }
3032
- // Update position sync status based on asset sync results
3033
- const syncStatus = this.determineSyncStatus(syncResults);
3034
- // Rebuild position with synced data
3035
- return this.buildUpdatedPosition(position, syncResults, syncStatus);
3015
+ // Process each position with awareness of the aggregated totals
3016
+ return platformPositions.map(position => this.syncPositionWithAggregateData(position, hlPositionsMap, platformTotalsByAsset));
3036
3017
  }
3037
3018
  /**
3038
- * Group assets by their base currency
3019
+ * Calculate total platform sizes per asset across all positions
3039
3020
  */
3040
- groupAssetsByBaseCurrency(assets) {
3041
- const grouped = new Map();
3042
- for (const asset of assets) {
3043
- const baseCurrency = asset.coin.split('/')[0] || asset.coin;
3044
- if (!grouped.has(baseCurrency)) {
3045
- grouped.set(baseCurrency, []);
3021
+ calculatePlatformTotalsByAsset(positions) {
3022
+ const totalsMap = new Map();
3023
+ for (const position of positions) {
3024
+ // Combine all assets from both sides
3025
+ const allAssets = [
3026
+ ...position.longAssets.map(asset => ({ ...asset, side: PositionSide.LONG })),
3027
+ ...position.shortAssets.map(asset => ({ ...asset, side: PositionSide.SHORT }))
3028
+ ];
3029
+ for (const asset of allAssets) {
3030
+ const baseCurrency = this.extractBaseCurrency(asset.coin);
3031
+ if (!totalsMap.has(baseCurrency)) {
3032
+ totalsMap.set(baseCurrency, {
3033
+ totalSize: 0,
3034
+ positions: []
3035
+ });
3036
+ }
3037
+ const totals = totalsMap.get(baseCurrency);
3038
+ const assetSize = asset.platformSize;
3039
+ totals.totalSize += assetSize;
3040
+ totals.positions.push({
3041
+ positionId: position.positionId,
3042
+ asset: asset,
3043
+ size: assetSize
3044
+ });
3046
3045
  }
3047
- grouped.get(baseCurrency).push(asset);
3048
3046
  }
3049
- return grouped;
3047
+ return totalsMap;
3050
3048
  }
3051
3049
  /**
3052
- * Sync a group of assets (same base currency) with HyperLiquid position data
3050
+ * Extract base currency from asset name (handles "LINK/USD" -> "LINK")
3053
3051
  */
3054
- syncAssetGroupWithHyperliquid(assets, hlPosition) {
3055
- const results = [];
3056
- // Calculate total platform size for this base currency
3057
- const totalPlatformSize = assets.reduce((sum, asset) => sum + asset.platformSize, 0);
3058
- const actualTotalSize = hlPosition ? Math.abs(Number(hlPosition.position.szi || 0)) : 0;
3059
- // Check if the total size matches (within tolerance)
3060
- const sizeDifference = Math.abs(actualTotalSize - totalPlatformSize);
3061
- const sizeDifferencePercentage = totalPlatformSize > 0
3062
- ? (sizeDifference / totalPlatformSize) * 100
3063
- : (actualTotalSize > 0 ? 100 : 0);
3064
- const isGroupExternallyModified = sizeDifferencePercentage > 0.1; // 0.1% tolerance
3065
- for (const asset of assets) {
3066
- const platformSize = asset.platformSize;
3067
- let actualSize = platformSize;
3068
- let isExternallyModified = isGroupExternallyModified;
3069
- let cumFunding = {
3070
- allTime: 0,
3071
- sinceChange: 0,
3072
- sinceOpen: 0
3073
- };
3074
- let unrealizedPnl = 0;
3075
- let liquidationPrice = 0;
3076
- if (hlPosition) {
3077
- // Proportionally distribute the actual size based on asset's contribution
3078
- const sizeRatio = totalPlatformSize > 0 ? platformSize / totalPlatformSize : 0;
3079
- actualSize = actualTotalSize * sizeRatio;
3080
- // Proportionally distribute funding and PnL based on asset's contribution
3081
- if (hlPosition.cumFunding) {
3082
- cumFunding = {
3083
- allTime: Number(hlPosition.cumFunding.allTime || 0),
3084
- sinceChange: Number(hlPosition.cumFunding.sinceChange || 0) * sizeRatio,
3085
- sinceOpen: Number(hlPosition.cumFunding.sinceOpen || 0) * sizeRatio
3086
- };
3052
+ extractBaseCurrency(assetName) {
3053
+ return assetName.split('/')[0] || assetName;
3054
+ }
3055
+ /**
3056
+ * Sync a single position with HyperLiquid data using aggregate totals
3057
+ */
3058
+ syncPositionWithAggregateData(position, hlPositionsMap, platformTotalsByAsset) {
3059
+ const syncResults = [];
3060
+ let hasExternalModification = false;
3061
+ let allAssetsClosed = true;
3062
+ // Separate tracking for long and short sides
3063
+ let longAssetStatuses = { total: 0, closed: 0 };
3064
+ let shortAssetStatuses = { total: 0, closed: 0 };
3065
+ // Process all assets
3066
+ const allAssets = [
3067
+ ...position.longAssets.map(asset => ({ ...asset, side: PositionSide.LONG })),
3068
+ ...position.shortAssets.map(asset => ({ ...asset, side: PositionSide.SHORT }))
3069
+ ];
3070
+ for (const asset of allAssets) {
3071
+ const baseCurrency = this.extractBaseCurrency(asset.coin);
3072
+ const hlPosition = hlPositionsMap.get(baseCurrency);
3073
+ const platformTotals = platformTotalsByAsset.get(baseCurrency);
3074
+ const syncResult = this.syncAssetWithAggregateData(asset, hlPosition, (platformTotals === null || platformTotals === void 0 ? void 0 : platformTotals.totalSize) || 0);
3075
+ syncResults.push(syncResult);
3076
+ // Track status by side
3077
+ if (asset.side === PositionSide.LONG) {
3078
+ longAssetStatuses.total++;
3079
+ if (syncResult.actualSize === 0) {
3080
+ longAssetStatuses.closed++;
3087
3081
  }
3088
- unrealizedPnl = Number(hlPosition.position.unrealizedPnl || 0) * sizeRatio;
3089
- liquidationPrice = Number(hlPosition.position.liquidationPx || 0);
3090
3082
  }
3091
- else {
3092
- // Position doesn't exist on HyperLiquid - it was closed externally
3093
- actualSize = 0;
3094
- isExternallyModified = true;
3083
+ else if (asset.side === PositionSide.SHORT) {
3084
+ shortAssetStatuses.total++;
3085
+ if (syncResult.actualSize === 0) {
3086
+ shortAssetStatuses.closed++;
3087
+ }
3095
3088
  }
3096
- results.push({
3089
+ // Update flags
3090
+ if (syncResult.isExternallyModified) {
3091
+ hasExternalModification = true;
3092
+ }
3093
+ if (syncResult.actualSize !== 0) {
3094
+ allAssetsClosed = false;
3095
+ }
3096
+ }
3097
+ // Determine sync status
3098
+ const syncStatus = this.determineSyncStatus(hasExternalModification, allAssetsClosed, longAssetStatuses, shortAssetStatuses);
3099
+ return this.buildUpdatedPosition(position, syncResults, syncStatus);
3100
+ }
3101
+ /**
3102
+ * Sync individual asset with aggregate data awareness
3103
+ */
3104
+ syncAssetWithAggregateData(asset, hlPosition, platformTotal) {
3105
+ var _a, _b, _c;
3106
+ const platformSize = asset.platformSize;
3107
+ // No position on HyperLiquid - asset was closed
3108
+ if (!hlPosition || !hlPosition.position || !hlPosition.position.szi) {
3109
+ return {
3097
3110
  asset,
3098
- actualSize,
3099
- isExternallyModified,
3100
- cumFunding,
3101
- unrealizedPnl,
3102
- liquidationPrice,
3111
+ actualSize: 0,
3112
+ isExternallyModified: true,
3113
+ cumFunding: { allTime: 0, sinceChange: 0, sinceOpen: 0 },
3114
+ unrealizedPnl: 0,
3115
+ liquidationPrice: 0,
3103
3116
  side: asset.side
3104
- });
3117
+ };
3105
3118
  }
3106
- return results;
3119
+ const hlTotalSize = Math.abs(Number(hlPosition.position.szi || 0));
3120
+ // Check if the TOTAL platform size matches HyperLiquid total
3121
+ const totalDifference = Math.abs(hlTotalSize - platformTotal);
3122
+ const tolerance = platformTotal * 0.001; // 0.1% tolerance
3123
+ const isExternallyModified = totalDifference > tolerance;
3124
+ // Calculate this position's proportional share of the HyperLiquid position
3125
+ const proportion = platformTotal > 0 ? platformSize / platformTotal : 0;
3126
+ const actualSize = hlTotalSize * proportion;
3127
+ // Distribute funding proportionally
3128
+ const cumFunding = {
3129
+ allTime: Number(((_a = hlPosition.cumFunding) === null || _a === void 0 ? void 0 : _a.allTime) || 0),
3130
+ sinceChange: Number(((_b = hlPosition.cumFunding) === null || _b === void 0 ? void 0 : _b.sinceChange) || 0) * proportion,
3131
+ sinceOpen: Number(((_c = hlPosition.cumFunding) === null || _c === void 0 ? void 0 : _c.sinceOpen) || 0) * proportion
3132
+ };
3133
+ // Distribute PnL proportionally
3134
+ const unrealizedPnl = Number(hlPosition.position.unrealizedPnl || 0) * proportion;
3135
+ // Liquidation price is the same for all positions of the same asset
3136
+ const liquidationPrice = Number(hlPosition.position.liquidationPx || 0);
3137
+ return {
3138
+ asset,
3139
+ actualSize,
3140
+ isExternallyModified,
3141
+ cumFunding,
3142
+ unrealizedPnl,
3143
+ liquidationPrice,
3144
+ side: asset.side
3145
+ };
3107
3146
  }
3108
3147
  /**
3109
- * Determine sync status based on asset sync results
3148
+ * Determine sync status with sophisticated side-aware logic
3110
3149
  */
3111
- determineSyncStatus(syncResults) {
3112
- const hasExternalModifications = syncResults.some(result => result.isExternallyModified);
3113
- const allAssetsClosed = syncResults.every(result => result.actualSize === 0);
3114
- const someAssetsClosed = syncResults.some(result => result.actualSize === 0) && !allAssetsClosed;
3150
+ determineSyncStatus(hasExternalModification, allAssetsClosed, longAssetStatuses, shortAssetStatuses) {
3151
+ // All assets closed externally
3115
3152
  if (allAssetsClosed) {
3116
3153
  return 'EXTERNALLY_CLOSED';
3117
3154
  }
3118
- else if (someAssetsClosed) {
3155
+ // Check if pair is broken (one entire side closed)
3156
+ const allLongsClosed = longAssetStatuses.total > 0 &&
3157
+ longAssetStatuses.closed === longAssetStatuses.total;
3158
+ const allShortsClosed = shortAssetStatuses.total > 0 &&
3159
+ shortAssetStatuses.closed === shortAssetStatuses.total;
3160
+ if ((allLongsClosed && !allShortsClosed) || (!allLongsClosed && allShortsClosed)) {
3119
3161
  return 'PAIR_BROKEN';
3120
3162
  }
3121
- else if (hasExternalModifications) {
3163
+ // External modification detected
3164
+ if (hasExternalModification) {
3122
3165
  return 'EXTERNALLY_MODIFIED';
3123
3166
  }
3167
+ // Everything synced properly
3124
3168
  return 'SYNCED';
3125
3169
  }
3126
3170
  /**
@@ -3167,65 +3211,38 @@ class PositionCalculator {
3167
3211
  };
3168
3212
  }
3169
3213
  /**
3170
- * Calculate entry ratio (weighted long entry value / weighted short entry value)
3214
+ * Calculate entry ratio using actual sizes from sync results
3171
3215
  */
3172
3216
  calculateEntryRatio(syncResults) {
3173
3217
  const longResults = syncResults.filter(result => result.side === PositionSide.LONG);
3174
3218
  const shortResults = syncResults.filter(result => result.side === PositionSide.SHORT);
3175
3219
  if (longResults.length === 0 || shortResults.length === 0)
3176
3220
  return 0;
3177
- // Calculate total position value at entry prices
3178
- const totalPositionValue = syncResults.reduce((sum, result) => {
3221
+ const longValue = longResults.reduce((sum, result) => {
3179
3222
  return sum + (result.actualSize * result.asset.entryPrice);
3180
3223
  }, 0);
3181
- if (totalPositionValue === 0)
3182
- return 0;
3183
- // Calculate weighted long portfolio entry value
3184
- const weightedLongValue = longResults.reduce((sum, result) => {
3185
- const entryPrice = result.asset.entryPrice;
3186
- const assetValue = result.actualSize * entryPrice;
3187
- const weight = assetValue / totalPositionValue;
3188
- return sum + (entryPrice * weight);
3189
- }, 0);
3190
- // Calculate weighted short portfolio entry value
3191
- const weightedShortValue = shortResults.reduce((sum, result) => {
3192
- const entryPrice = result.asset.entryPrice;
3193
- const assetValue = result.actualSize * entryPrice;
3194
- const weight = assetValue / totalPositionValue;
3195
- return sum + (entryPrice * weight);
3224
+ const shortValue = shortResults.reduce((sum, result) => {
3225
+ return sum + (result.actualSize * result.asset.entryPrice);
3196
3226
  }, 0);
3197
- return weightedShortValue > 0 ? weightedLongValue / weightedShortValue : 0;
3227
+ return shortValue > 0 ? longValue / shortValue : 0;
3198
3228
  }
3199
3229
  /**
3200
- * Calculate mark ratio (weighted long mark value / weighted short mark value)
3230
+ * Calculate mark ratio using actual sizes and current prices
3201
3231
  */
3202
3232
  calculateMarkRatio(syncResults) {
3203
3233
  const longResults = syncResults.filter(result => result.side === PositionSide.LONG);
3204
3234
  const shortResults = syncResults.filter(result => result.side === PositionSide.SHORT);
3205
3235
  if (longResults.length === 0 || shortResults.length === 0)
3206
3236
  return 0;
3207
- // Calculate total position value at current market prices
3208
- const totalPositionValue = syncResults.reduce((sum, result) => {
3237
+ const longValue = longResults.reduce((sum, result) => {
3209
3238
  const currentPrice = this.getMarketPrice(result.asset.coin);
3210
3239
  return sum + (result.actualSize * currentPrice);
3211
3240
  }, 0);
3212
- if (totalPositionValue === 0)
3213
- return 0;
3214
- // Calculate weighted long portfolio value
3215
- const weightedLongValue = longResults.reduce((sum, result) => {
3241
+ const shortValue = shortResults.reduce((sum, result) => {
3216
3242
  const currentPrice = this.getMarketPrice(result.asset.coin);
3217
- const assetValue = result.actualSize * currentPrice;
3218
- const weight = assetValue / totalPositionValue;
3219
- return sum + (currentPrice * weight);
3220
- }, 0);
3221
- // Calculate weighted short portfolio value
3222
- const weightedShortValue = shortResults.reduce((sum, result) => {
3223
- const currentPrice = this.getMarketPrice(result.asset.coin);
3224
- const assetValue = result.actualSize * currentPrice;
3225
- const weight = assetValue / totalPositionValue;
3226
- return sum + (currentPrice * weight);
3243
+ return sum + (result.actualSize * currentPrice);
3227
3244
  }, 0);
3228
- return weightedShortValue > 0 ? weightedLongValue / weightedShortValue : 0;
3245
+ return shortValue > 0 ? longValue / shortValue : 0;
3229
3246
  }
3230
3247
  /**
3231
3248
  * Calculate net funding from sync results
@@ -3282,7 +3299,7 @@ const useCalculatedOpenPositions = (platformPositions, webData2, allMids) => {
3282
3299
  availableMids: Object.keys(allMids.mids || {}).length
3283
3300
  });
3284
3301
  // Create calculator and compute positions
3285
- const calculator = new PositionCalculator(webData2, allMids);
3302
+ const calculator = new AggregatePositionCalculator(webData2, allMids);
3286
3303
  const calculated = calculator.calculateOpenPositions(platformPositions);
3287
3304
  console.log('[useCalculatedOpenPositions] Calculation completed', {
3288
3305
  inputCount: platformPositions.length,
@@ -3472,5 +3489,5 @@ const useAccountSummary = () => {
3472
3489
  return calculatedAccountSummary;
3473
3490
  };
3474
3491
 
3475
- export { AccountSummaryCalculator, PearHyperliquidClient, PearHyperliquidProvider, PearMigrationSDK, PositionCalculator, PositionSide, PearHyperliquidClient as default, useAccountSummary, useAddress, useCalculatedAccountSummary, useCalculatedOpenPositions, useHyperliquidNativeWebSocket, useHyperliquidWebSocket, useMigrationSDK, useOpenOrders, useOpenPositions, usePearHyperliquidClient, useTradeHistories };
3492
+ export { AccountSummaryCalculator, AggregatePositionCalculator, PearHyperliquidClient, PearHyperliquidProvider, PearMigrationSDK, PositionSide, PearHyperliquidClient as default, useAccountSummary, useAddress, useCalculatedAccountSummary, useCalculatedOpenPositions, useHyperliquidNativeWebSocket, useHyperliquidWebSocket, useMigrationSDK, useOpenOrders, useOpenPositions, usePearHyperliquidClient, useTradeHistories };
3476
3493
  //# sourceMappingURL=index.esm.js.map