@kamino-finance/klend-sdk 3.2.21 → 3.2.22
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/classes/reserve.js
CHANGED
|
@@ -784,7 +784,7 @@ class KaminoReserve {
|
|
|
784
784
|
.flat();
|
|
785
785
|
const caps = {
|
|
786
786
|
// Utilization cap
|
|
787
|
-
utilizationCap: new decimal_js_1.default(utilizationCap > 0 ? utilizationCap :
|
|
787
|
+
utilizationCap: new decimal_js_1.default(utilizationCap > 0 ? utilizationCap / 100 : 1),
|
|
788
788
|
utilizationCurrentValue: new decimal_js_1.default(utilizationCurrentValue),
|
|
789
789
|
// Daily borrow cap
|
|
790
790
|
netWithdrawalCap: new decimal_js_1.default(withdrawalCap.configCapacity.toString()),
|
|
@@ -806,7 +806,7 @@ class KaminoReserve {
|
|
|
806
806
|
const caps = this.getBorrowCapForReserve(market);
|
|
807
807
|
const liquidityAvailable = this.getLiquidityAvailableAmount();
|
|
808
808
|
// Cap this to utilization cap first
|
|
809
|
-
const utilizationRatioLimit = caps.utilizationCap
|
|
809
|
+
const utilizationRatioLimit = caps.utilizationCap;
|
|
810
810
|
const currentUtilizationRatio = this.calculateUtilizationRatio();
|
|
811
811
|
const liquidityGivenUtilizationCap = this.getTotalSupply().mul(utilizationRatioLimit.minus(currentUtilizationRatio));
|
|
812
812
|
const remainingDailyCap = caps.netWithdrawalCap.minus(caps.netWithdrawalCurrentValue);
|