@1delta/margin-fetcher 0.0.85 → 0.0.86

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.js CHANGED
@@ -11997,6 +11997,7 @@ var getCompoundV2ReservesDataConverter = (lender, chainId, prices, additionalYie
11997
11997
  const totalDebt = Number(
11998
11998
  parseRawAmount(currentEntry?.totalBorrows?.toString(), decs)
11999
11999
  );
12000
+ const liquidity = totalSupplyUnderlying - totalDebt;
12000
12001
  const price = prices[asset.assetGroup] ?? 0;
12001
12002
  const pausedActions = decodePausedActions(currentEntry.pausedActions);
12002
12003
  const allPaused = pausedActions[0 /* MINT */] && pausedActions[2 /* BORROW */] && pausedActions[1 /* REDEEM */] && pausedActions[3 /* REPAY */];
@@ -12014,7 +12015,8 @@ var getCompoundV2ReservesDataConverter = (lender, chainId, prices, additionalYie
12014
12015
  Lender.COMPOUND_V2
12015
12016
  ),
12016
12017
  stableBorrowRate: 0,
12017
- // deposits
12018
+ totalLiquidity: liquidity,
12019
+ totalLiquidityUSD: liquidity * price,
12018
12020
  totalDebt,
12019
12021
  totalDebtUSD: totalDebt * price,
12020
12022
  totalDeposits: totalSupplyUnderlying,
@@ -18297,8 +18299,8 @@ var getCompoundV2UserDataConverter = (lender, chainId, account, prices, pricesHi
18297
18299
  }
18298
18300
  };
18299
18301
  function createCompoundV2Entry(i, data, assetsIn, vToken, asset, prices, pricesHist, claimableRewards) {
18300
- const depositsRaw = data[2 * i];
18301
- const borrowsRaw = data[2 * i + 1];
18302
+ const depositsRaw = data[2 * i].toString();
18303
+ const borrowsRaw = data[2 * i + 1].toString();
18302
18304
  if (depositsRaw === "0" && borrowsRaw === "0") {
18303
18305
  return {
18304
18306
  dataForAsset: void 0,