@haven-fi/solauto-sdk 1.0.130 → 1.0.132

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.
@@ -74,7 +74,7 @@ function getSolautoFeesBps(isReferred, targetLiqUtilizationRateBps, positionNetW
74
74
  const k = 1.5;
75
75
  let feeBps = 0;
76
76
  if (targetLiqUtilizationRateBps !== undefined) {
77
- feeBps = minFeeBps;
77
+ feeBps = 10;
78
78
  }
79
79
  else if (positionNetWorthUsd <= minSize) {
80
80
  feeBps = maxFeeBps;
@@ -83,7 +83,7 @@ function getRebalanceValues(state, settings, dca, currentUnixTime, supplyPrice,
83
83
  if (state === undefined ||
84
84
  state.lastUpdated <
85
85
  BigInt(Math.round((0, generalUtils_2.currentUnixSeconds)() - solautoConstants_1.MIN_POSITION_STATE_FRESHNESS_SECS))) {
86
- throw new Error("Requires a fresh position state to get rebalance details");
86
+ console.warn("Requires a fresh position state to get rebalance details");
87
87
  }
88
88
  const { targetRateBps, amountToDcaIn } = getTargetRateAndDcaAmount(state, settings, dca, currentUnixTime, targetLiqUtilizationRateBps);
89
89
  const amountUsdToDcaIn = (0, numberUtils_1.fromBaseUnit)(BigInt(Math.round(amountToDcaIn ?? 0)), state.debt.decimals) *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.130",
3
+ "version": "1.0.132",
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",
@@ -104,7 +104,7 @@ export function getSolautoFeesBps(
104
104
  let feeBps: number = 0;
105
105
 
106
106
  if (targetLiqUtilizationRateBps !== undefined) {
107
- feeBps = minFeeBps;
107
+ feeBps = 10;
108
108
  } else if (positionNetWorthUsd <= minSize) {
109
109
  feeBps = maxFeeBps;
110
110
  } else if (positionNetWorthUsd >= maxSize) {
@@ -183,7 +183,7 @@ export function getRebalanceValues(
183
183
  Math.round(currentUnixSeconds() - MIN_POSITION_STATE_FRESHNESS_SECS)
184
184
  )
185
185
  ) {
186
- throw new Error("Requires a fresh position state to get rebalance details");
186
+ console.warn("Requires a fresh position state to get rebalance details");
187
187
  }
188
188
 
189
189
  const { targetRateBps, amountToDcaIn } = getTargetRateAndDcaAmount(