@haven-fi/solauto-sdk 1.0.49 → 1.0.50

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.
@@ -75,8 +75,8 @@ function eligibileForRebalance(positionState, positionSettings, positionDca) {
75
75
  if (positionState.liqUtilizationRateBps <= boostFrom) {
76
76
  return true;
77
77
  }
78
- else if (positionState.liqUtilizationRateBps >= repayFrom ||
79
- repayFrom - positionState.liqUtilizationRateBps < repayFrom * 0.01) {
78
+ else if (positionState.liqUtilizationRateBps >= repayFrom) {
79
+ console.log(`Requires repay ${positionState.liqUtilizationRateBps} > ${repayFrom}`);
80
80
  return true;
81
81
  }
82
82
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
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",
@@ -150,9 +150,9 @@ export function eligibileForRebalance(
150
150
  if (positionState.liqUtilizationRateBps <= boostFrom) {
151
151
  return true;
152
152
  } else if (
153
- positionState.liqUtilizationRateBps >= repayFrom ||
154
- repayFrom - positionState.liqUtilizationRateBps < repayFrom * 0.01
153
+ positionState.liqUtilizationRateBps >= repayFrom
155
154
  ) {
155
+ console.log(`Requires repay ${positionState.liqUtilizationRateBps} > ${repayFrom}`);
156
156
  return true;
157
157
  }
158
158
 
@@ -5,6 +5,7 @@ import {
5
5
  SolautoMarginfiClient,
6
6
  } from "../../src/clients/solautoMarginfiClient";
7
7
  import {
8
+ LendingPlatform,
8
9
  solautoAction,
9
10
  SolautoSettingsParametersInpArgs,
10
11
  } from "../../src/generated";
@@ -18,6 +19,7 @@ import {
18
19
  } from "../../src/transactions/transactionsManager";
19
20
  import { PublicKey } from "@solana/web3.js";
20
21
  import { USDC_MINT } from "../../src/constants";
22
+ import { positionStateWithLatestPrices } from "../../src/utils/solauto/generalUtils";
21
23
 
22
24
  describe("Solauto Marginfi tests", async () => {
23
25
  // const signer = setupTest();
@@ -25,7 +27,7 @@ describe("Solauto Marginfi tests", async () => {
25
27
 
26
28
  const payForTransactions = false;
27
29
  const useJitoBundle = false;
28
- const positionId = 1;
30
+ const positionId = 2;
29
31
 
30
32
  it("open - deposit - borrow - rebalance to 0 - withdraw - close", async () => {
31
33
  const client = new SolautoMarginfiClient(process.env.HELIUS_API_KEY!, true);