@kamino-finance/klend-sdk 5.13.14 → 5.13.16

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.
@@ -129,10 +129,7 @@ export function calcMaxWithdrawCollateral(
129
129
  .getDeposits()
130
130
  .filter((p) => !p.reserveAddress.equals(deposit.reserveAddress))
131
131
  .reduce((acc, d) => {
132
- const { maxLtv, liquidationLtv } = obligation.getLtvForReserve(
133
- market,
134
- market.getExistingReserveByAddress(d.reserveAddress)
135
- );
132
+ const { maxLtv, liquidationLtv } = obligation.getLtvForReserve(market, d.reserveAddress);
136
133
  const maxWithdrawLtv =
137
134
  maxWithdrawLtvCheck === MaxWithdrawLtvCheck.LIQUIDATION_THRESHOLD ? liquidationLtv : maxLtv;
138
135
  return acc.add(d.marketValueRefreshed.mul(maxWithdrawLtv));
@@ -150,7 +147,7 @@ export function calcMaxWithdrawCollateral(
150
147
  } else {
151
148
  const { maxLtv: collMaxLtv, liquidationLtv: collLiquidationLtv } = obligation.getLtvForReserve(
152
149
  market,
153
- market.getReserveByAddress(depositReserve.address)!
150
+ depositReserve.address
154
151
  );
155
152
  const maxWithdrawLtv =
156
153
  maxWithdrawLtvCheck === MaxWithdrawLtvCheck.LIQUIDATION_THRESHOLD ? collLiquidationLtv : collMaxLtv;
@@ -424,7 +424,7 @@ function calculatePostOperationLtv(
424
424
  new Decimal(0),
425
425
  obligation.refreshedStats.userTotalDeposit.sub(collWithdrawValue)
426
426
  );
427
-
427
+
428
428
  const newMaxBorrowableValue = Decimal.max(
429
429
  new Decimal(0),
430
430
  obligation.refreshedStats.borrowLimit.sub(collWithdrawValue.mul(collReserve.stats.loanToValue))