@haven-fi/solauto-sdk 1.0.163 → 1.0.164
Sign up to get free protection for your applications and to get access to all the features.
@@ -101,10 +101,10 @@ function getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps, offsetFromMaxLt
|
|
101
101
|
return toBps((fromBps(maxLtvBps) - offsetFromMaxLtv) / fromBps(liqThresholdBps)) - 1; // -1 to account for any rounding issues
|
102
102
|
}
|
103
103
|
function maxRepayFromBps(maxLtvBps, liqThresholdBps) {
|
104
|
-
return Math.min(9000, getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps - 1000, 0.
|
104
|
+
return Math.min(9000, getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps - 1000, 0.01));
|
105
105
|
}
|
106
106
|
function maxRepayToBps(maxLtvBps, liqThresholdBps) {
|
107
|
-
return Math.min(maxRepayFromBps(maxLtvBps, liqThresholdBps) - constants_1.MIN_REPAY_GAP_BPS, getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps, 0.
|
107
|
+
return Math.min(maxRepayFromBps(maxLtvBps, liqThresholdBps) - constants_1.MIN_REPAY_GAP_BPS, getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps, 0.01));
|
108
108
|
}
|
109
109
|
function maxBoostToBps(maxLtvBps, liqThresholdBps) {
|
110
110
|
return Math.min(maxRepayToBps(maxLtvBps, liqThresholdBps), getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps, 0.01));
|
package/package.json
CHANGED
package/src/utils/numberUtils.ts
CHANGED
@@ -139,14 +139,14 @@ export function getMaxLiqUtilizationRateBps(
|
|
139
139
|
export function maxRepayFromBps(maxLtvBps: number, liqThresholdBps: number) {
|
140
140
|
return Math.min(
|
141
141
|
9000,
|
142
|
-
getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps - 1000, 0.
|
142
|
+
getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps - 1000, 0.01)
|
143
143
|
);
|
144
144
|
}
|
145
145
|
|
146
146
|
export function maxRepayToBps(maxLtvBps: number, liqThresholdBps: number) {
|
147
147
|
return Math.min(
|
148
148
|
maxRepayFromBps(maxLtvBps, liqThresholdBps) - MIN_REPAY_GAP_BPS,
|
149
|
-
getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps, 0.
|
149
|
+
getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps, 0.01)
|
150
150
|
);
|
151
151
|
}
|
152
152
|
|