@haven-fi/solauto-sdk 1.0.531 → 1.0.533

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.
@@ -1 +1 @@
1
- {"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EAEL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAa7D,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAqCD,qBAAa,eAAe;IAMjB,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM;IARtB,oBAAoB,EAAG,MAAM,EAAE,CAAC;IAChC,EAAE,CAAC,EAAE,kBAAkB,CAAC;IACjB,WAAW,EAAE,OAAO,CAAS;gBAG3B,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,EACxC,IAAI,CAAC,EAAE,MAAM,YAAA;IAGhB,UAAU;IAKV,OAAO,CAAC,UAAU,EAAE,MAAM;IAMhC,cAAc,IAAI,MAAM,EAAE;CAY3B;AAqGD,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;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A4I7B,qBAAqB;YAoDrB,eAAe;YA0Df,eAAe;CA4D9B"}
1
+ {"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EAEL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAa7D,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAqCD,qBAAa,eAAe;IAMjB,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM;IARtB,oBAAoB,EAAG,MAAM,EAAE,CAAC;IAChC,EAAE,CAAC,EAAE,kBAAkB,CAAC;IACjB,WAAW,EAAE,OAAO,CAAS;gBAG3B,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,EACxC,IAAI,CAAC,EAAE,MAAM,YAAA;IAGhB,UAAU;IAKV,OAAO,CAAC,UAAU,EAAE,MAAM;IAMhC,cAAc,IAAI,MAAM,EAAE;CAY3B;AAqGD,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,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actionsManager {
336
336
  }
337
337
  else if (attemptNum > 0) {
338
338
  for (const item of items) {
339
- await item.refetch(0);
339
+ await item.refetch(attemptNum);
340
340
  }
341
341
  }
342
342
  this.txHandler.log("Transaction items:", items.length);
343
343
  return await this.assembleTransactionSets(items);
344
- }, 2);
344
+ }, this.totalRetries);
345
345
  this.updateStatusForSets(itemSets, TransactionStatus.Queued, 0);
346
346
  this.txHandler.log("Initial item sets:", itemSets.length);
347
347
  if (this.atomically) {
@@ -445,23 +445,21 @@ class TransactionsManager {
445
445
  }, this.totalRetries, this.retryDelay, this.errorsToThrow);
446
446
  }
447
447
  async refreshItemSets(itemSets, attemptNum, currentIndex) {
448
- const newItemSets = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => {
449
- if (currentIndex !== undefined) {
450
- const itemSet = itemSets[currentIndex];
448
+ if (currentIndex !== undefined) {
449
+ const itemSet = itemSets[currentIndex];
450
+ await itemSet.refetchAll(attemptNum);
451
+ }
452
+ else {
453
+ for (const itemSet of itemSets) {
451
454
  await itemSet.refetchAll(attemptNum);
452
455
  }
453
- else {
454
- for (const itemSet of itemSets) {
455
- await itemSet.refetchAll(attemptNum);
456
- }
457
- }
458
- return await this.assembleTransactionSets(currentIndex !== undefined
459
- ? [
460
- ...itemSets[currentIndex].items,
461
- ...itemSets.slice(currentIndex + 1).flatMap((set) => set.items),
462
- ]
463
- : itemSets.flatMap((set) => set.items));
464
- }, 2);
456
+ }
457
+ const newItemSets = await this.assembleTransactionSets(currentIndex !== undefined
458
+ ? [
459
+ ...itemSets[currentIndex].items,
460
+ ...itemSets.slice(currentIndex + 1).flatMap((set) => set.items),
461
+ ]
462
+ : itemSets.flatMap((set) => set.items));
465
463
  const newItemSetNames = newItemSets.map((x) => x.name());
466
464
  if (newItemSetNames.length === 1 &&
467
465
  newItemSetNames[0] === this.updateOracleTxName) {
@@ -1 +1 @@
1
- {"version":3,"file":"jupiterUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jupiterUtils.ts"],"names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C,OAAO,EAAE,SAAS,EAA0B,MAAM,iBAAiB,CAAC;AAGpE,OAAO,EAGL,aAAa,EACd,MAAM,aAAa,CAAC;AAUrB,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,SAAS,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,iBAAiB,EAAE,SAAS,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAgBD,wBAAsB,WAAW,CAAC,WAAW,EAAE,YAAY,0BAsB1D;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,aAAa,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,aAAa,EAAE,kBAAkB,CAAC;IAClC,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,cAAc,EAC3B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,kBAAkB,CAAC,CAmF7B;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,EAAE,OAAO;;GA6B5E"}
@@ -91,16 +91,16 @@ async function getJupPriceData(mints, extraInfo) {
91
91
  mints.map((x) => x.toString()).join(",") +
92
92
  (extraInfo ? "&showExtraInfo=true" : ""))).json();
93
93
  const result = res.data;
94
- if (!result ||
95
- result === null ||
96
- (typeof result === "object" &&
97
- Boolean(Object.values(result).filter((x) => x === null).length)) ||
98
- (typeof result === "object" &&
99
- Object.values(result)
100
- .map((x) => parseFloat(x.price))
101
- .includes(0))) {
94
+ if (!result || result === null || typeof result !== "object") {
102
95
  throw new Error("Failed to get token prices using Jupiter");
103
96
  }
97
+ const invalidValues = Boolean(Object.values(result).filter((x) => x === null).length) ||
98
+ Boolean(Object.values(result)
99
+ .map((x) => parseFloat(x.price))
100
+ .filter((x) => x <= 0).length);
101
+ if (invalidValues) {
102
+ throw new Error("Invalid price values");
103
+ }
104
104
  return result;
105
105
  }, 8);
106
106
  return data;
@@ -99,7 +99,7 @@ async function getSwitchboardPrices(mints) {
99
99
  prices = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => {
100
100
  const res = await crossbar.simulateSolanaFeeds("mainnet", mints.map((x) => switchboardConstants_1.SWITCHBOARD_PRICE_FEED_IDS[x.toString()]));
101
101
  const p = res.flatMap((x) => x.results[0]);
102
- if (p.filter((x) => !x || isNaN(Number(x))).length > 0) {
102
+ if (p.filter((x) => !x || isNaN(Number(x)) || Number(x) < 0).length > 0) {
103
103
  throw new Error("Unable to fetch Switchboard prices");
104
104
  }
105
105
  return p;
@@ -144,8 +144,8 @@ function postRebalanceLiqUtilizationRateBps(client, values, swapOutputAmount) {
144
144
  debtUsd = boost ? debtUsd + debtAdjustmentUsdAbs : debtUsd - swapOutputUsd;
145
145
  return (0, numberUtils_1.getLiqUtilzationRateBps)(supplyUsd, debtUsd, client.solautoPositionState?.liqThresholdBps ?? 0);
146
146
  }
147
- function insufficientLiquidity(amountNeeded, liquidity, tokenDecimals, tokenPrice) {
148
- return amountNeeded > (0, numberUtils_1.fromBaseUnit)(liquidity, tokenDecimals) * tokenPrice;
147
+ function insufficientLiquidity(amountNeededUsd, liquidity, tokenDecimals, tokenPrice) {
148
+ return amountNeededUsd > (0, numberUtils_1.fromBaseUnit)(liquidity, tokenDecimals) * tokenPrice;
149
149
  }
150
150
  async function getFlashLoanRequirements(client, values, attemptNum) {
151
151
  let supplyUsd = (0, numberUtils_1.fromBaseUnit)(client.solautoPositionState.supply.amountUsed.baseAmountUsdValue, generalAccounts_1.USD_DECIMALS) +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.531",
3
+ "version": "1.0.533",
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",
@@ -546,12 +546,12 @@ export class TransactionsManager {
546
546
  }
547
547
  } else if (attemptNum > 0) {
548
548
  for (const item of items) {
549
- await item.refetch(0);
549
+ await item.refetch(attemptNum);
550
550
  }
551
551
  }
552
552
  this.txHandler.log("Transaction items:", items.length);
553
553
  return await this.assembleTransactionSets(items);
554
- }, 2);
554
+ }, this.totalRetries);
555
555
 
556
556
  this.updateStatusForSets(itemSets, TransactionStatus.Queued, 0);
557
557
  this.txHandler.log("Initial item sets:", itemSets.length);
@@ -766,25 +766,23 @@ export class TransactionsManager {
766
766
  attemptNum: number,
767
767
  currentIndex?: number
768
768
  ): Promise<TransactionSet[] | undefined> {
769
- const newItemSets = await retryWithExponentialBackoff(async () => {
770
- if (currentIndex !== undefined) {
771
- const itemSet = itemSets[currentIndex];
769
+ if (currentIndex !== undefined) {
770
+ const itemSet = itemSets[currentIndex];
771
+ await itemSet.refetchAll(attemptNum);
772
+ } else {
773
+ for (const itemSet of itemSets) {
772
774
  await itemSet.refetchAll(attemptNum);
773
- } else {
774
- for (const itemSet of itemSets) {
775
- await itemSet.refetchAll(attemptNum);
776
- }
777
775
  }
776
+ }
778
777
 
779
- return await this.assembleTransactionSets(
780
- currentIndex !== undefined
781
- ? [
782
- ...itemSets[currentIndex].items,
783
- ...itemSets.slice(currentIndex + 1).flatMap((set) => set.items),
784
- ]
785
- : itemSets.flatMap((set) => set.items)
786
- );
787
- }, 2);
778
+ const newItemSets = await this.assembleTransactionSets(
779
+ currentIndex !== undefined
780
+ ? [
781
+ ...itemSets[currentIndex].items,
782
+ ...itemSets.slice(currentIndex + 1).flatMap((set) => set.items),
783
+ ]
784
+ : itemSets.flatMap((set) => set.items)
785
+ );
788
786
 
789
787
  const newItemSetNames = newItemSets.map((x) => x.name());
790
788
  if (
@@ -181,18 +181,21 @@ export async function getJupPriceData(mints: PublicKey[], extraInfo?: boolean) {
181
181
  )
182
182
  ).json();
183
183
  const result = res.data;
184
- if (
185
- !result ||
186
- result === null ||
187
- (typeof result === "object" &&
188
- Boolean(Object.values(result).filter((x) => x === null).length)) ||
189
- (typeof result === "object" &&
184
+ if (!result || result === null || typeof result !== "object") {
185
+ throw new Error("Failed to get token prices using Jupiter");
186
+ }
187
+
188
+ const invalidValues =
189
+ Boolean(Object.values(result).filter((x) => x === null).length) ||
190
+ Boolean(
190
191
  Object.values(result)
191
192
  .map((x) => parseFloat((x as any).price))
192
- .includes(0))
193
- ) {
194
- throw new Error("Failed to get token prices using Jupiter");
193
+ .filter((x) => x <= 0).length
194
+ );
195
+ if (invalidValues) {
196
+ throw new Error("Invalid price values");
195
197
  }
198
+
196
199
  return result;
197
200
  }, 8);
198
201
 
@@ -115,7 +115,7 @@ export async function getSwitchboardPrices(
115
115
  );
116
116
 
117
117
  const p = res.flatMap((x) => x.results[0]);
118
- if (p.filter((x) => !x || isNaN(Number(x))).length > 0) {
118
+ if (p.filter((x) => !x || isNaN(Number(x)) || Number(x) < 0).length > 0) {
119
119
  throw new Error("Unable to fetch Switchboard prices");
120
120
  }
121
121
 
@@ -302,12 +302,12 @@ function postRebalanceLiqUtilizationRateBps(
302
302
  }
303
303
 
304
304
  function insufficientLiquidity(
305
- amountNeeded: number,
305
+ amountNeededUsd: number,
306
306
  liquidity: bigint,
307
307
  tokenDecimals: number,
308
308
  tokenPrice: number
309
309
  ) {
310
- return amountNeeded > fromBaseUnit(liquidity, tokenDecimals) * tokenPrice;
310
+ return amountNeededUsd > fromBaseUnit(liquidity, tokenDecimals) * tokenPrice;
311
311
  }
312
312
 
313
313
  export interface FlashLoanRequirements {
@@ -42,14 +42,13 @@ import {
42
42
  } from "../../src/utils";
43
43
  import { PriorityFeeSetting } from "../../src/types";
44
44
  import { buildIronforgeApiUrl, fromBaseUnit, tokenInfo, USD_DECIMALS } from "../../dist";
45
- import { JUPITER_PROGRAM_ID } from "../../src/jupiter-sdk";
46
45
 
47
46
  describe("Solauto Marginfi tests", async () => {
48
- // const signer = setupTest();
49
- const signer = setupTest("solauto-manager");
47
+ const signer = setupTest();
48
+ // const signer = setupTest("solauto-manager");
50
49
 
51
- const payForTransactions = true;
52
- const testProgram = false;
50
+ const payForTransactions = false;
51
+ const testProgram = true;
53
52
  const positionId = 1;
54
53
 
55
54
  it("open - deposit - borrow - rebalance to 0 - withdraw - close", async () => {
@@ -66,7 +65,7 @@ describe("Solauto Marginfi tests", async () => {
66
65
  await client.initialize({
67
66
  signer,
68
67
  positionId,
69
- authority: new PublicKey("EBhRj7jbF2EVE21i19JSuCX1BAbnZFYhoKW64HnaZ3kf"),
68
+ // authority: new PublicKey("FKYQs7KgRvaKQHxXwb8HKfoBcFdSxLL3JvHWpPdVQ16v"),
70
69
  // new: true,
71
70
  // marginfiAccount: new PublicKey(
72
71
  // ""
@@ -146,7 +145,7 @@ describe("Solauto Marginfi tests", async () => {
146
145
  transactionItems.push(
147
146
  new TransactionItem(
148
147
  async (attemptNum) =>
149
- await buildSolautoRebalanceTransaction(client, undefined, attemptNum),
148
+ await buildSolautoRebalanceTransaction(client, 2000, attemptNum),
150
149
  "rebalance"
151
150
  )
152
151
  );