@haven-fi/solauto-sdk 1.0.142 → 1.0.143
Sign up to get free protection for your applications and to get access to all the features.
@@ -81,10 +81,10 @@ function eligibleForRebalance(positionState, positionSettings, positionDca, curr
|
|
81
81
|
: positionSettings.boostToBps;
|
82
82
|
const repayFrom = positionSettings.repayToBps + positionSettings.repayGap;
|
83
83
|
const boostFrom = boostToBps - positionSettings.boostGap;
|
84
|
-
if (Math.max(0, positionState.liqUtilizationRateBps - boostFrom)
|
84
|
+
if (Math.max(0, positionState.liqUtilizationRateBps - boostFrom) <= bpsDistanceThreshold) {
|
85
85
|
return "boost";
|
86
86
|
}
|
87
|
-
else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps)
|
87
|
+
else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps) <= bpsDistanceThreshold) {
|
88
88
|
return "repay";
|
89
89
|
}
|
90
90
|
return undefined;
|
package/package.json
CHANGED
@@ -145,9 +145,9 @@ export function eligibleForRebalance(
|
|
145
145
|
const repayFrom = positionSettings.repayToBps + positionSettings.repayGap;
|
146
146
|
const boostFrom = boostToBps - positionSettings.boostGap;
|
147
147
|
|
148
|
-
if (Math.max(0, positionState.liqUtilizationRateBps - boostFrom)
|
148
|
+
if (Math.max(0, positionState.liqUtilizationRateBps - boostFrom) <= bpsDistanceThreshold) {
|
149
149
|
return "boost";
|
150
|
-
} else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps)
|
150
|
+
} else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps) <= bpsDistanceThreshold) {
|
151
151
|
return "repay";
|
152
152
|
}
|
153
153
|
|