@haven-fi/solauto-sdk 1.0.309 → 1.0.311

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.
@@ -27,7 +27,7 @@ import {
27
27
  SOLAUTO_TEST_PROGRAM,
28
28
  USDC,
29
29
  } from "../../src/constants";
30
- import { buildHeliusApiUrl, getSolautoManagedPositions, positionStateWithLatestPrices } from "../../src/utils";
30
+ import { buildHeliusApiUrl } from "../../src/utils";
31
31
  import { PriorityFeeSetting } from "../../src/types";
32
32
 
33
33
  describe("Solauto Marginfi tests", async () => {
@@ -41,8 +41,8 @@ describe("Solauto Marginfi tests", async () => {
41
41
  it("open - deposit - borrow - rebalance to 0 - withdraw - close", async () => {
42
42
  const client = new SolautoMarginfiClient(
43
43
  buildHeliusApiUrl(process.env.HELIUS_API_KEY!),
44
- true
45
- // testProgram ? SOLAUTO_TEST_PROGRAM : SOLAUTO_PROD_PROGRAM
44
+ true,
45
+ testProgram ? SOLAUTO_TEST_PROGRAM : SOLAUTO_PROD_PROGRAM
46
46
  );
47
47
 
48
48
  const supply = NATIVE_MINT;
@@ -52,7 +52,7 @@ describe("Solauto Marginfi tests", async () => {
52
52
  await client.initialize({
53
53
  signer,
54
54
  positionId,
55
- authority: new PublicKey("rC5dMP5dmSsfQ66rynzfFzuc122Eex9h1RJHVDkeH6D"),
55
+ authority: new PublicKey("rC5dMP5dmSsfQ66rynzfFzuc122Eex9h1RJHVDkeH6D"), // positions 1 & 3 are taken
56
56
  // new: true,
57
57
  // marginfiAccount: new PublicKey(
58
58
  // "4nNvUXF5YqHFcH2nGweSiuvy1ct7V5FXfoCLKFYUN36z"
@@ -63,20 +63,20 @@ describe("Solauto Marginfi tests", async () => {
63
63
  });
64
64
 
65
65
  const transactionItems: TransactionItem[] = [];
66
- const settingParams: SolautoSettingsParametersInpArgs = {
67
- boostToBps: maxBoostToBps(
68
- client.solautoPositionState?.maxLtvBps ?? 0,
69
- client.solautoPositionState?.liqThresholdBps ?? 0
70
- ),
71
- boostGap: 50,
72
- repayToBps: maxRepayToBps(
73
- client.solautoPositionState?.maxLtvBps ?? 0,
74
- client.solautoPositionState?.liqThresholdBps ?? 0
75
- ),
76
- repayGap: 50,
77
- automation: none(),
78
- targetBoostToBps: none(),
79
- };
66
+ // const settingParams: SolautoSettingsParametersInpArgs = {
67
+ // boostToBps: maxBoostToBps(
68
+ // client.solautoPositionState?.maxLtvBps ?? 0,
69
+ // client.solautoPositionState?.liqThresholdBps ?? 0
70
+ // ),
71
+ // boostGap: 50,
72
+ // repayToBps: maxRepayToBps(
73
+ // client.solautoPositionState?.maxLtvBps ?? 0,
74
+ // client.solautoPositionState?.liqThresholdBps ?? 0
75
+ // ),
76
+ // repayGap: 50,
77
+ // automation: none(),
78
+ // targetBoostToBps: none(),
79
+ // };
80
80
 
81
81
  // if (client.solautoPositionData === null) {
82
82
  // transactionItems.push(
@@ -123,7 +123,7 @@ describe("Solauto Marginfi tests", async () => {
123
123
  transactionItems.push(
124
124
  new TransactionItem(
125
125
  async (attemptNum) =>
126
- await buildSolautoRebalanceTransaction(client, 3000, attemptNum),
126
+ await buildSolautoRebalanceTransaction(client, 5000, attemptNum),
127
127
  "rebalance"
128
128
  )
129
129
  );
@@ -156,13 +156,14 @@ describe("Solauto Marginfi tests", async () => {
156
156
  // )
157
157
  // );
158
158
 
159
- // const statuses = await new TransactionsManager(
160
- // client,
161
- // undefined,
162
- // !payForTransactions ? "only-simulate" : "normal",
163
- // PriorityFeeSetting.Low
164
- // ).clientSend(transactionItems);
159
+ const statuses = await new TransactionsManager(
160
+ client,
161
+ undefined,
162
+ !payForTransactions ? "only-simulate" : "normal",
163
+ PriorityFeeSetting.Low,
164
+ true
165
+ ).clientSend(transactionItems);
165
166
 
166
- // console.log(statuses);
167
+ console.log(statuses);
167
168
  });
168
169
  });