@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) / boostFrom >= bpsDistanceThreshold) {
84
+ if (Math.max(0, positionState.liqUtilizationRateBps - boostFrom) <= bpsDistanceThreshold) {
85
85
  return "boost";
86
86
  }
87
- else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps) >= bpsDistanceThreshold) {
87
+ else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps) <= bpsDistanceThreshold) {
88
88
  return "repay";
89
89
  }
90
90
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.142",
3
+ "version": "1.0.143",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Typescript SDK for the Solauto program on the Solana blockchain",
@@ -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) / boostFrom >= bpsDistanceThreshold) {
148
+ if (Math.max(0, positionState.liqUtilizationRateBps - boostFrom) <= bpsDistanceThreshold) {
149
149
  return "boost";
150
- } else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps) >= bpsDistanceThreshold) {
150
+ } else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps) <= bpsDistanceThreshold) {
151
151
  return "repay";
152
152
  }
153
153