@hyperix/hooks 0.2.2 → 0.2.3
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/lib/balances.js +1 -1
- package/package.json +1 -1
package/dist/lib/balances.js
CHANGED
|
@@ -154,7 +154,7 @@ export function buildBalancesData(input) {
|
|
|
154
154
|
const perpBalances = input.isUnifiedAccount
|
|
155
155
|
? []
|
|
156
156
|
: buildPerpBalances(input.clearinghouseState, input.perpMarkets);
|
|
157
|
-
const balances = [...perpBalances, ...spotBalances];
|
|
157
|
+
const balances = [...perpBalances, ...spotBalances].filter((balance) => balance.value !== 0);
|
|
158
158
|
const rawSpotEquity = sumBy(balances.filter((balance) => balance.type === "spot"), (balance) => balance.value);
|
|
159
159
|
const rawPerpEquity = sumBy(balances.filter((balance) => balance.type === "perp"), (balance) => balance.value);
|
|
160
160
|
const tradingEquity = input.isUnifiedAccount
|