@pear-protocol/utils
Advanced tools
+6
-3
@@ -823,3 +823,6 @@ import BigNumber9 from 'bignumber.js'; | ||
| const position = { | ||
| positionKey: book.keyFor(Object.keys(p.exposure)), | ||
| // Trust the position's own stored key — never recompute it from exposure. | ||
| // A partial fill on the original order leaves exposure short of the | ||
| // symbols the key was hashed from, so a recomputed key would never match. | ||
| positionKey: p.positionKey, | ||
| exposure: Exposure.fromRecord(p.exposure), | ||
@@ -1110,3 +1113,3 @@ parts: [], | ||
| const existing = existingBySymbol.get(symbol); | ||
| const positionKey = existing ? keyOf(Object.keys(existing.exposure)) : keyOf([symbol]); | ||
| const positionKey = existing ? existing.positionKey : keyOf([symbol]); | ||
| target = positions.find((pos) => pos.positionKey === positionKey) ?? created.find((pos) => pos.positionKey === positionKey); | ||
@@ -1752,2 +1755,2 @@ if (!target) { | ||
| export { BIPS, ZERO, abs, add, baseToContracts, compareValue, computeAssetEntryNotional, computeAssetGrossRealizedPnL, computeAssetRealizedPnLs, computeAssetUndeterminedSizes, computeAssetUnrealizedPnL, computeAssetUnrealizedPnLs, computeBasketWeightedRatioV1, computeEntryPriceForAsset, computePositionEntryPrices, computeRealizedPnlBySymbol, computeRealizedPnlFromFills, computeRealizedPositionState, computeSyncPayload, computeUnrealizedPositionState, computeUnrealizedPositionStateFromEntryPrices, configureProxy, contractsToBase, countDecimals, divide, exponentiate, generateDeterministicPositionKey, isEqualTo, isFiniteDecimal, isGreaterThan, isGreaterThanOrEqual, isLessThan, isLessThanOrEqual, isNegative, isPositive, isZero, min, multiply, negate, parse, precisePrice, preciseQuantity, proxyFetch, sideSign, sign, signed, signedBySide, subtract, toDecimalString, validateLeverage, validateQuantity }; | ||
| export { BIPS, ZERO, abs, add, baseToContracts, buildApplicables, compareValue, computeAssetEntryNotional, computeAssetGrossRealizedPnL, computeAssetRealizedPnLs, computeAssetUndeterminedSizes, computeAssetUnrealizedPnL, computeAssetUnrealizedPnLs, computeBasketWeightedRatioV1, computeEntryPriceForAsset, computePositionEntryPrices, computeRealizedPnlBySymbol, computeRealizedPnlFromFills, computeRealizedPositionState, computeSyncPayload, computeUnrealizedPositionState, computeUnrealizedPositionStateFromEntryPrices, configureProxy, contractsToBase, countDecimals, divide, exponentiate, generateDeterministicPositionKey, isEqualTo, isFiniteDecimal, isGreaterThan, isGreaterThanOrEqual, isLessThan, isLessThanOrEqual, isNegative, isPositive, isZero, min, multiply, negate, parse, precisePrice, preciseQuantity, proxyFetch, sideSign, sign, signed, signedBySide, subtract, toDecimalString, validateLeverage, validateQuantity }; |
@@ -0,2 +1,3 @@ | ||
| export { buildApplicables } from './applicables'; | ||
| export { computeSyncPayload } from './compute'; | ||
| export type { ComputeSyncPayloadArgs, ComputeSyncPayloadResult } from './types'; |
+2
-2
| { | ||
| "name": "@pear-protocol/utils", | ||
| "version": "0.2.0", | ||
| "version": "0.3.0", | ||
| "description": "Pear Protocol Utility functions", | ||
@@ -30,3 +30,3 @@ "private": false, | ||
| "@noble/hashes": "^1.3.2", | ||
| "@pear-protocol/types": "^1.9.0", | ||
| "@pear-protocol/types": "^1.14.1", | ||
| "bignumber.js": "9.3.1" | ||
@@ -33,0 +33,0 @@ }, |
98695
0.28%2582
0.16%Updated