@haven-fi/solauto-sdk 1.0.235 → 1.0.237

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAoBxE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAsCzD,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAO7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAqLjD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAkH7B;AA2LD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA0BnD;AAED,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,aAAa,oBA2CzE;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CA2H5C;AAED,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,oBAAoB,EACrC,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsC5C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG;;;;EAuDxE"}
1
+ {"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAoBxE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAsCzD,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAO7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAqLjD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAkH7B;AA2LD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA0BnD;AAED,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,aAAa,oBA2CzE;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsH5C;AAED,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,oBAAoB,EACrC,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsC5C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG;;;;EAuDxE"}
@@ -364,10 +364,6 @@ async function buildSolautoRebalanceTransaction(client, targetLiqUtilizationRate
364
364
  }
365
365
  const values = (0, rebalanceUtils_1.getRebalanceValues)(client.solautoPositionState, client.solautoPositionSettings(), client.solautoPositionActiveDca(), (0, generalUtils_1.currentUnixSeconds)(), (0, generalUtils_1.safeGetPrice)(client.supplyMint), (0, generalUtils_1.safeGetPrice)(client.debtMint), targetLiqUtilizationRateBps);
366
366
  client.log("Rebalance values: ", values);
367
- // Don't perform automated solauto manager boost if the fees are less than the transaction cost
368
- if (targetLiqUtilizationRateBps === undefined && values.rebalanceDirection === generated_1.RebalanceDirection.Boost && values.feesUsd < 1) {
369
- return undefined;
370
- }
371
367
  const swapDetails = (0, rebalanceUtils_1.getJupSwapRebalanceDetails)(client, values, targetLiqUtilizationRateBps, attemptNum);
372
368
  const { jupQuote, lookupTableAddresses, setupInstructions, tokenLedgerIx, swapIx, } = await (0, jupiterUtils_1.getJupSwapTransaction)(client.signer, swapDetails, attemptNum);
373
369
  const flashLoan = (0, rebalanceUtils_1.getFlashLoanDetails)(client, values, jupQuote);
@@ -36,10 +36,9 @@ export declare class TransactionsManager {
36
36
  private errorsToThrow?;
37
37
  private retries;
38
38
  private retryDelay;
39
- private confirmTimeout;
40
39
  private statuses;
41
40
  private lookupTables;
42
- constructor(txHandler: SolautoClient | ReferralStateManager, statusCallback?: ((statuses: TransactionManagerStatuses) => void) | undefined, txType?: TransactionRunType | undefined, mustBeAtomic?: boolean | undefined, errorsToThrow?: ErrorsToThrow | undefined, retries?: number, retryDelay?: number, confirmTimeout?: number);
41
+ constructor(txHandler: SolautoClient | ReferralStateManager, statusCallback?: ((statuses: TransactionManagerStatuses) => void) | undefined, txType?: TransactionRunType | undefined, mustBeAtomic?: boolean | undefined, errorsToThrow?: ErrorsToThrow | undefined, retries?: number, retryDelay?: number);
43
42
  private assembleTransactionSets;
44
43
  private updateStatus;
45
44
  private debugAccounts;
@@ -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,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CN,aAAa;IAoBd,UAAU,CACrB,YAAY,EAAE,eAAe,EAAE,EAC/B,eAAe,CAAC,EAAE,kBAAkB,GACnC,OAAO,CAAC,0BAA0B,CAAC;IAyEzB,IAAI,CACf,KAAK,EAAE,eAAe,EAAE,EACxB,eAAe,CAAC,EAAE,kBAAkB,EACpC,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,0BAA0B,CAAC;YAwGxB,eAAe;CAkD9B"}
@@ -119,7 +119,7 @@ var TransactionStatus;
119
119
  TransactionStatus["Failed"] = "Failed";
120
120
  })(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
121
121
  class TransactionsManager {
122
- constructor(txHandler, statusCallback, txType, mustBeAtomic, errorsToThrow, retries = 4, retryDelay = 150, confirmTimeout = 15000) {
122
+ constructor(txHandler, statusCallback, txType, mustBeAtomic, errorsToThrow, retries = 4, retryDelay = 150) {
123
123
  this.txHandler = txHandler;
124
124
  this.statusCallback = statusCallback;
125
125
  this.txType = txType;
@@ -127,7 +127,6 @@ class TransactionsManager {
127
127
  this.errorsToThrow = errorsToThrow;
128
128
  this.retries = retries;
129
129
  this.retryDelay = retryDelay;
130
- this.confirmTimeout = confirmTimeout;
131
130
  this.statuses = [];
132
131
  this.lookupTables = new LookupTables(this.txHandler.defaultLookupTables(), this.txHandler.umi);
133
132
  }
@@ -331,7 +330,7 @@ class TransactionsManager {
331
330
  async sendTransaction(tx, txName, attemptNum, prioritySetting) {
332
331
  this.updateStatus(txName, TransactionStatus.Processing, attemptNum);
333
332
  try {
334
- const txSig = await (0, solanaUtils_1.sendSingleOptimizedTransaction)(this.txHandler.umi, this.txHandler.connection, tx, this.txType, this.confirmTimeout, prioritySetting, () => this.updateStatus(txName, TransactionStatus.Processing, attemptNum, undefined, true));
333
+ const txSig = await (0, solanaUtils_1.sendSingleOptimizedTransaction)(this.txHandler.umi, this.txHandler.connection, tx, this.txType, prioritySetting, () => this.updateStatus(txName, TransactionStatus.Processing, attemptNum, undefined, true));
335
334
  this.updateStatus(txName, TransactionStatus.Successful, attemptNum, txSig ? bs58_1.default.encode(txSig) : undefined);
336
335
  }
337
336
  catch (e) {
@@ -14,5 +14,5 @@ export declare function splTokenTransferUmiIx(signer: Signer, fromTa: PublicKey,
14
14
  export declare function getAddressLookupInputs(umi: Umi, lookupTableAddresses: string[]): Promise<AddressLookupTableInput[]>;
15
15
  export declare function assembleFinalTransaction(signer: Signer, tx: TransactionBuilder, computeUnitPrice?: number, computeUnitLimit?: number): TransactionBuilder;
16
16
  export declare function getComputeUnitPriceEstimate(umi: Umi, tx: TransactionBuilder, prioritySetting: PriorityFeeSetting): Promise<number | undefined>;
17
- export declare function sendSingleOptimizedTransaction(umi: Umi, connection: Connection, tx: TransactionBuilder, txType?: TransactionRunType, confirmTimeout?: number, prioritySetting?: PriorityFeeSetting, onAwaitingSign?: () => void): Promise<Uint8Array | undefined>;
17
+ export declare function sendSingleOptimizedTransaction(umi: Umi, connection: Connection, tx: TransactionBuilder, txType?: TransactionRunType, prioritySetting?: PriorityFeeSetting, onAwaitingSign?: () => void): Promise<Uint8Array | undefined>;
18
18
  //# sourceMappingURL=solanaUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"solanaUtils.d.ts","sourceRoot":"","sources":["../../src/utils/solanaUtils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,MAAM,EACN,kBAAkB,EAClB,GAAG,EACH,kBAAkB,EAGnB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAKL,UAAU,EACV,SAAS,EAKT,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;AAgBzB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAIlE,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,UAErD;AAED,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,UAE3D;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,SAAS,GAAE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ED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,SAAS,EACtB,QAAQ,EAAE,MAAM,GACf,kBAAkB,CASpB;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,SAAS,EACvB,SAAS,EAAE,SAAS,GACnB,kBAAkB,CAKpB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,kBAAkB,CAKpB;AAED,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,GAAG,EACR,oBAAoB,EAAE,MAAM,EAAE,GAC7B,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAkBpC;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,kBAAkB,EACtB,gBAAgB,CAAC,EAAE,MAAM,EACzB,gBAAgB,CAAC,EAAE,MAAM,sBAgE1B;AAmBD,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,kBAAkB,EACtB,eAAe,EAAE,kBAAkB,GAClC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAsB7B;AAiDD,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,kBAAkB,EACtB,MAAM,CAAC,EAAE,kBAAkB,EAC3B,eAAe,GAAE,kBAA2C,EAC5D,cAAc,CAAC,EAAE,MAAM,IAAI,GAC1B,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CA6EjC"}
@@ -166,60 +166,39 @@ async function getComputeUnitPriceEstimate(umi, tx, prioritySetting) {
166
166
  }
167
167
  return feeEstimate;
168
168
  }
169
- async function spamSendTransactionUntilConfirmed(connection, transaction, blockhash, confirmTimeout = 15000, spamInterval = 1000) {
170
- let spamAttempts = 0;
171
- let confirmed = false;
169
+ async function spamSendTransactionUntilConfirmed(connection, transaction, blockhash, spamInterval = 1000) {
172
170
  let transactionSignature = null;
173
- return new Promise((resolve, reject) => {
174
- const spamSend = async () => {
175
- if (confirmed) {
176
- return;
177
- }
178
- try {
179
- const txSignature = await connection.sendRawTransaction(Buffer.from(transaction.serialize()), { skipPreflight: true, maxRetries: 0 });
180
- transactionSignature = txSignature;
181
- (0, generalUtils_1.consoleLog)(`Transaction sent`);
182
- }
183
- catch (error) {
184
- (0, generalUtils_1.consoleLog)("Error sending transaction:", error);
185
- }
186
- spamAttempts++;
187
- if (!confirmed) {
188
- setTimeout(spamSend, spamInterval);
189
- }
190
- };
191
- const confirmTransaction = async () => {
192
- if (transactionSignature) {
193
- try {
194
- const { value } = await connection.confirmTransaction({
195
- ...blockhash,
196
- signature: transactionSignature,
197
- });
198
- if (value.err) {
199
- reject(value.err);
200
- }
201
- confirmed = true;
202
- resolve(transactionSignature);
203
- }
204
- catch (error) {
205
- (0, generalUtils_1.consoleLog)("Error during confirmation:", error);
206
- }
207
- }
208
- if (!confirmed) {
209
- setTimeout(confirmTransaction, 1000);
210
- }
211
- };
212
- spamSend();
213
- confirmTransaction();
214
- setTimeout(() => {
215
- if (!confirmed) {
216
- confirmed = true;
217
- reject(new Error("Failed to confirm transaction within timeout"));
218
- }
219
- }, confirmTimeout);
171
+ const sendTx = async () => {
172
+ try {
173
+ const txSignature = await connection.sendRawTransaction(Buffer.from(transaction.serialize()), { skipPreflight: true, maxRetries: 0 });
174
+ transactionSignature = txSignature;
175
+ (0, generalUtils_1.consoleLog)(`Transaction sent`);
176
+ }
177
+ catch (error) {
178
+ (0, generalUtils_1.consoleLog)("Error sending transaction:", error);
179
+ }
180
+ };
181
+ await sendTx();
182
+ const sendIntervalId = setInterval(async () => {
183
+ await sendTx();
184
+ }, spamInterval);
185
+ if (!transactionSignature) {
186
+ throw new Error("Failed to send");
187
+ }
188
+ const resp = await connection
189
+ .confirmTransaction({
190
+ ...blockhash,
191
+ signature: transactionSignature,
192
+ })
193
+ .finally(() => {
194
+ clearInterval(sendIntervalId);
220
195
  });
196
+ if (resp.value.err) {
197
+ throw resp.value.err;
198
+ }
199
+ return transactionSignature;
221
200
  }
222
- async function sendSingleOptimizedTransaction(umi, connection, tx, txType, confirmTimeout = 15000, prioritySetting = types_1.PriorityFeeSetting.Default, onAwaitingSign) {
201
+ async function sendSingleOptimizedTransaction(umi, connection, tx, txType, prioritySetting = types_1.PriorityFeeSetting.Min, onAwaitingSign) {
223
202
  (0, generalUtils_1.consoleLog)("Sending single optimized transaction...");
224
203
  (0, generalUtils_1.consoleLog)("Instructions: ", tx.getInstructions().length);
225
204
  (0, generalUtils_1.consoleLog)("Serialized transaction size: ", tx.getTransactionSize(umi));
@@ -259,7 +238,7 @@ async function sendSingleOptimizedTransaction(umi, connection, tx, txType, confi
259
238
  const signedTx = await assembleFinalTransaction(umi.identity, tx, cuPrice, computeUnitLimit)
260
239
  .setBlockhash(blockhash)
261
240
  .buildAndSign(umi);
262
- const txSig = await spamSendTransactionUntilConfirmed(connection, (0, umi_web3js_adapters_1.toWeb3JsTransaction)(signedTx), blockhash, confirmTimeout);
241
+ const txSig = await spamSendTransactionUntilConfirmed(connection, (0, umi_web3js_adapters_1.toWeb3JsTransaction)(signedTx), blockhash);
263
242
  (0, generalUtils_1.consoleLog)(`Transaction signature: ${txSig}`);
264
243
  (0, generalUtils_1.consoleLog)(`https://solscan.io/tx/${txSig}`);
265
244
  return bs58_1.default.decode(txSig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.235",
3
+ "version": "1.0.237",
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",
@@ -666,11 +666,6 @@ export async function buildSolautoRebalanceTransaction(
666
666
  );
667
667
  client.log("Rebalance values: ", values);
668
668
 
669
- // Don't perform automated solauto manager boost if the fees are less than the transaction cost
670
- if (targetLiqUtilizationRateBps === undefined && values.rebalanceDirection === RebalanceDirection.Boost && values.feesUsd < 1) {
671
- return undefined;
672
- }
673
-
674
669
  const swapDetails = getJupSwapRebalanceDetails(
675
670
  client,
676
671
  values,
@@ -200,7 +200,6 @@ export class TransactionsManager {
200
200
  private errorsToThrow?: ErrorsToThrow,
201
201
  private retries: number = 4,
202
202
  private retryDelay: number = 150,
203
- private confirmTimeout: number = 15000
204
203
  ) {
205
204
  this.lookupTables = new LookupTables(
206
205
  this.txHandler.defaultLookupTables(),
@@ -511,7 +510,6 @@ export class TransactionsManager {
511
510
  this.txHandler.connection,
512
511
  tx,
513
512
  this.txType,
514
- this.confirmTimeout,
515
513
  prioritySetting,
516
514
  () =>
517
515
  this.updateStatus(
@@ -300,68 +300,47 @@ async function spamSendTransactionUntilConfirmed(
300
300
  connection: Connection,
301
301
  transaction: Transaction | VersionedTransaction,
302
302
  blockhash: BlockhashWithExpiryBlockHeight,
303
- confirmTimeout: number = 15000,
304
303
  spamInterval: number = 1000
305
304
  ): Promise<string> {
306
- let spamAttempts = 0;
307
- let confirmed = false;
308
305
  let transactionSignature: string | null = null;
309
306
 
310
- return new Promise<string>((resolve, reject) => {
311
- const spamSend = async () => {
312
- if (confirmed) {
313
- return;
314
- }
307
+ const sendTx = async () => {
308
+ try {
309
+ const txSignature = await connection.sendRawTransaction(
310
+ Buffer.from(transaction.serialize()),
311
+ { skipPreflight: true, maxRetries: 0 }
312
+ );
313
+ transactionSignature = txSignature;
314
+ consoleLog(`Transaction sent`);
315
+ } catch (error) {
316
+ consoleLog("Error sending transaction:", error);
317
+ }
318
+ };
315
319
 
316
- try {
317
- const txSignature = await connection.sendRawTransaction(
318
- Buffer.from(transaction.serialize()),
319
- { skipPreflight: true, maxRetries: 0 }
320
- );
321
- transactionSignature = txSignature;
322
- consoleLog(`Transaction sent`);
323
- } catch (error) {
324
- consoleLog("Error sending transaction:", error);
325
- }
320
+ await sendTx();
326
321
 
327
- spamAttempts++;
328
- if (!confirmed) {
329
- setTimeout(spamSend, spamInterval);
330
- }
331
- };
332
-
333
- const confirmTransaction = async () => {
334
- if (transactionSignature) {
335
- try {
336
- const { value } = await connection.confirmTransaction({
337
- ...blockhash,
338
- signature: transactionSignature,
339
- });
340
- if (value.err) {
341
- reject(value.err);
342
- }
343
- confirmed = true;
344
- resolve(transactionSignature);
345
- } catch (error) {
346
- consoleLog("Error during confirmation:", error);
347
- }
348
- }
322
+ const sendIntervalId = setInterval(async () => {
323
+ await sendTx();
324
+ }, spamInterval);
349
325
 
350
- if (!confirmed) {
351
- setTimeout(confirmTransaction, 1000);
352
- }
353
- };
326
+ if (!transactionSignature) {
327
+ throw new Error("Failed to send");
328
+ }
354
329
 
355
- spamSend();
356
- confirmTransaction();
330
+ const resp = await connection
331
+ .confirmTransaction({
332
+ ...blockhash,
333
+ signature: transactionSignature,
334
+ })
335
+ .finally(() => {
336
+ clearInterval(sendIntervalId);
337
+ });
357
338
 
358
- setTimeout(() => {
359
- if (!confirmed) {
360
- confirmed = true;
361
- reject(new Error("Failed to confirm transaction within timeout"));
362
- }
363
- }, confirmTimeout);
364
- });
339
+ if (resp.value.err) {
340
+ throw resp.value.err;
341
+ }
342
+
343
+ return transactionSignature;
365
344
  }
366
345
 
367
346
  export async function sendSingleOptimizedTransaction(
@@ -369,8 +348,7 @@ export async function sendSingleOptimizedTransaction(
369
348
  connection: Connection,
370
349
  tx: TransactionBuilder,
371
350
  txType?: TransactionRunType,
372
- confirmTimeout: number = 15000,
373
- prioritySetting: PriorityFeeSetting = PriorityFeeSetting.Default,
351
+ prioritySetting: PriorityFeeSetting = PriorityFeeSetting.Min,
374
352
  onAwaitingSign?: () => void
375
353
  ): Promise<Uint8Array | undefined> {
376
354
  consoleLog("Sending single optimized transaction...");
@@ -440,8 +418,7 @@ export async function sendSingleOptimizedTransaction(
440
418
  const txSig = await spamSendTransactionUntilConfirmed(
441
419
  connection,
442
420
  toWeb3JsTransaction(signedTx),
443
- blockhash,
444
- confirmTimeout
421
+ blockhash
445
422
  );
446
423
 
447
424
  consoleLog(`Transaction signature: ${txSig}`);
@@ -142,6 +142,6 @@ describe("Solauto Marginfi tests", async () => {
142
142
  undefined,
143
143
  !payForTransactions ? "only-simulate" : "normal",
144
144
  useJitoBundle
145
- ).clientSend(transactionItems, PriorityFeeSetting.None);
145
+ ).clientSend(transactionItems, PriorityFeeSetting.Min);
146
146
  });
147
147
  });