@haven-fi/solauto-sdk 1.0.189 → 1.0.191
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/clients/solautoMarginfiClient.js +1 -1
- package/dist/utils/marginfiUtils.d.ts.map +1 -1
- package/dist/utils/marginfiUtils.js +2 -1
- package/dist/utils/solanaUtils.d.ts +1 -1
- package/dist/utils/solanaUtils.d.ts.map +1 -1
- package/dist/utils/solanaUtils.js +21 -12
- package/package.json +1 -1
- package/src/clients/solautoMarginfiClient.ts +2 -2
- package/src/utils/marginfiUtils.ts +4 -1
- package/src/utils/solanaUtils.ts +22 -13
- package/tests/transactions/solautoMarginfi.ts +2 -2
@@ -434,7 +434,7 @@ class SolautoMarginfiClient extends solautoClient_1.SolautoClient {
|
|
434
434
|
if (state) {
|
435
435
|
return state;
|
436
436
|
}
|
437
|
-
const freshState = await (0, marginfiUtils_1.getMarginfiAccountPositionState)(this.umi, this.marginfiAccountPk, undefined, undefined, this.livePositionUpdates);
|
437
|
+
const freshState = await (0, marginfiUtils_1.getMarginfiAccountPositionState)(this.umi, this.marginfiAccountPk, this.selfManaged ? undefined : this.supplyMint, this.selfManaged ? undefined : this.debtMint, this.livePositionUpdates);
|
438
438
|
if (freshState) {
|
439
439
|
this.log("Fresh state", freshState);
|
440
440
|
const supplyPrice = (0, generalUtils_1.safeGetPrice)(freshState?.supply.mint);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marginfiUtils.d.ts","sourceRoot":"","sources":["../../src/utils/marginfiUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAa,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EACL,IAAI,EAKL,MAAM,iBAAiB,CAAC;AAczB,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAA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,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,GAAG,qBAAqB,CAU3E;AAED,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,GAAG,EACR,MAAM,EAAE;IACN,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB,EACD,IAAI,EAAE;IACJ,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB,EACD,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA+D3B;AAED,wBAAsB,iCAAiC,CACrD,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,qBAAqB,CAAC,EAAE,OAAO,GAC9B,OAAO,CACR;IAAE,eAAe,EAAE,SAAS,CAAC;IAAC,UAAU,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,EAAE,CAC/E,CAwDA;AAgED,wBAAsB,+BAA+B,CACnD,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,SAAS,EAC5B,UAAU,CAAC,EAAE,SAAS,EACtB,QAAQ,CAAC,EAAE,SAAS,EACpB,mBAAmB,CAAC,EAAE,mBAAmB,GACxC,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CA6JpC;AA+DD,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAyB3B"}
|
@@ -183,7 +183,8 @@ async function getMarginfiAccountPositionState(umi, marginfiAccountPk, supplyMin
|
|
183
183
|
if (!supplyUsage) {
|
184
184
|
supplyUsage = await getTokenUsage(umi, supplyBank, true, 0, livePositionUpdates?.supplyAdjustment);
|
185
185
|
}
|
186
|
-
if (constants_1.TOKEN_INFO[
|
186
|
+
if (constants_1.TOKEN_INFO[supplyBank.mint.toString()].isStableCoin &&
|
187
|
+
(debtBank === null || constants_1.TOKEN_INFO[debtBank.mint.toString()].isStableCoin)) {
|
187
188
|
return undefined;
|
188
189
|
}
|
189
190
|
if (!debtUsage) {
|
@@ -13,6 +13,6 @@ export declare function closeTokenAccountUmiIx(signer: Signer, tokenAccount: Pub
|
|
13
13
|
export declare function splTokenTransferUmiIx(signer: Signer, fromTa: PublicKey, toTa: PublicKey, authority: PublicKey, amount: bigint): WrappedInstruction;
|
14
14
|
export declare function getAdressLookupInputs(umi: Umi, lookupTableAddresses: string[]): Promise<AddressLookupTableInput[]>;
|
15
15
|
export declare function assembleFinalTransaction(signer: Signer, tx: TransactionBuilder, computeUnitPrice: number, computeUnitLimit?: number): TransactionBuilder;
|
16
|
-
export declare function getComputeUnitPriceEstimate(umi: Umi, tx: TransactionBuilder, prioritySetting: PriorityFeeSetting): Promise<number>;
|
16
|
+
export declare function getComputeUnitPriceEstimate(umi: Umi, tx: TransactionBuilder, prioritySetting: PriorityFeeSetting): Promise<number | undefined>;
|
17
17
|
export declare function sendSingleOptimizedTransaction(umi: Umi, connection: Connection, tx: TransactionBuilder, txType?: TransactionRunType, attemptNum?: number, 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,EAGL,UAAU,EACV,SAAS,EAIT,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;AAYzB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EA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AAY,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,qBAAqB,CACzC,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,EAAE,MAAM,EACxB,gBAAgB,CAAC,EAAE,MAAM,sBA4D1B;AAmBD,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,kBAAkB,EACtB,eAAe,EAAE,kBAAkB,GAClC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAsB7B;AAED,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,kBAAkB,EACtB,MAAM,CAAC,EAAE,kBAAkB,EAC3B,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,GAAE,kBAA+C,EAChE,cAAc,CAAC,EAAE,MAAM,IAAI,GAC1B,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAkEjC"}
|
@@ -141,33 +141,42 @@ async function simulateTransaction(connection, transaction) {
|
|
141
141
|
async function getComputeUnitPriceEstimate(umi, tx, prioritySetting) {
|
142
142
|
const web3Transaction = (0, umi_web3js_adapters_1.toWeb3JsTransaction)((await tx.setLatestBlockhash(umi, { commitment: "finalized" })).build(umi));
|
143
143
|
const serializedTransaction = bs58_1.default.encode(web3Transaction.serialize());
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
144
|
+
let feeEstimate;
|
145
|
+
try {
|
146
|
+
const resp = await umi.rpc.call("getPriorityFeeEstimate", [
|
147
|
+
{
|
148
|
+
transaction: serializedTransaction,
|
149
|
+
options: {
|
150
|
+
priorityLevel: prioritySetting.toString(),
|
151
|
+
},
|
149
152
|
},
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
+
]);
|
154
|
+
feeEstimate = Math.round(resp.priorityFeeEstimate);
|
155
|
+
}
|
156
|
+
catch (e) {
|
157
|
+
console.error(e);
|
158
|
+
}
|
153
159
|
return feeEstimate;
|
154
160
|
}
|
155
161
|
async function sendSingleOptimizedTransaction(umi, connection, tx, txType, attemptNum, prioritySetting = types_1.PriorityFeeSetting.Default, onAwaitingSign) {
|
156
162
|
(0, generalUtils_1.consoleLog)("Sending single optimized transaction...");
|
157
163
|
(0, generalUtils_1.consoleLog)("Instructions: ", tx.getInstructions().length);
|
158
164
|
(0, generalUtils_1.consoleLog)("Serialized transaction size: ", tx.getTransactionSize(umi));
|
159
|
-
|
160
|
-
(
|
165
|
+
let cuPrice = await getComputeUnitPriceEstimate(umi, tx, prioritySetting);
|
166
|
+
if (!cuPrice) {
|
167
|
+
cuPrice = 1000000;
|
168
|
+
}
|
169
|
+
(0, generalUtils_1.consoleLog)("Compute unit price: ", cuPrice);
|
161
170
|
let computeUnitLimit = undefined;
|
162
171
|
if (txType !== "skip-simulation") {
|
163
172
|
// TODO: we should only retry simulation if it's not a solauto error
|
164
|
-
const simulationResult = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await simulateTransaction(connection, (0, umi_web3js_adapters_1.toWeb3JsTransaction)(await (await assembleFinalTransaction(umi.identity, tx,
|
173
|
+
const simulationResult = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await simulateTransaction(connection, (0, umi_web3js_adapters_1.toWeb3JsTransaction)(await (await assembleFinalTransaction(umi.identity, tx, cuPrice, 1400000).setLatestBlockhash(umi)).build(umi))), 3);
|
165
174
|
computeUnitLimit = Math.round(simulationResult.value.unitsConsumed * 1.1);
|
166
175
|
(0, generalUtils_1.consoleLog)("Compute unit limit: ", computeUnitLimit);
|
167
176
|
}
|
168
177
|
if (txType !== "only-simulate") {
|
169
178
|
onAwaitingSign?.();
|
170
|
-
const result = await assembleFinalTransaction(umi.identity, tx,
|
179
|
+
const result = await assembleFinalTransaction(umi.identity, tx, cuPrice, computeUnitLimit).sendAndConfirm(umi, {
|
171
180
|
send: {
|
172
181
|
skipPreflight: true,
|
173
182
|
commitment: "confirmed",
|
package/package.json
CHANGED
@@ -651,8 +651,8 @@ export class SolautoMarginfiClient extends SolautoClient {
|
|
651
651
|
const freshState = await getMarginfiAccountPositionState(
|
652
652
|
this.umi,
|
653
653
|
this.marginfiAccountPk,
|
654
|
-
undefined,
|
655
|
-
undefined,
|
654
|
+
this.selfManaged ? undefined : this.supplyMint,
|
655
|
+
this.selfManaged ? undefined : this.debtMint,
|
656
656
|
this.livePositionUpdates
|
657
657
|
);
|
658
658
|
|
@@ -343,7 +343,10 @@ export async function getMarginfiAccountPositionState(
|
|
343
343
|
);
|
344
344
|
}
|
345
345
|
|
346
|
-
if (
|
346
|
+
if (
|
347
|
+
TOKEN_INFO[supplyBank.mint.toString()].isStableCoin &&
|
348
|
+
(debtBank === null || TOKEN_INFO[debtBank.mint.toString()].isStableCoin)
|
349
|
+
) {
|
347
350
|
return undefined;
|
348
351
|
}
|
349
352
|
|
package/src/utils/solanaUtils.ts
CHANGED
@@ -254,20 +254,26 @@ export async function getComputeUnitPriceEstimate(
|
|
254
254
|
umi: Umi,
|
255
255
|
tx: TransactionBuilder,
|
256
256
|
prioritySetting: PriorityFeeSetting
|
257
|
-
): Promise<number> {
|
257
|
+
): Promise<number | undefined> {
|
258
258
|
const web3Transaction = toWeb3JsTransaction(
|
259
259
|
(await tx.setLatestBlockhash(umi, { commitment: "finalized" })).build(umi)
|
260
260
|
);
|
261
261
|
const serializedTransaction = bs58.encode(web3Transaction.serialize());
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
262
|
+
|
263
|
+
let feeEstimate: number | undefined;
|
264
|
+
try {
|
265
|
+
const resp = await umi.rpc.call("getPriorityFeeEstimate", [
|
266
|
+
{
|
267
|
+
transaction: serializedTransaction,
|
268
|
+
options: {
|
269
|
+
priorityLevel: prioritySetting.toString(),
|
270
|
+
},
|
267
271
|
},
|
268
|
-
|
269
|
-
|
270
|
-
|
272
|
+
]);
|
273
|
+
feeEstimate = Math.round((resp as any).priorityFeeEstimate as number);
|
274
|
+
} catch (e) {
|
275
|
+
console.error(e);
|
276
|
+
}
|
271
277
|
|
272
278
|
return feeEstimate;
|
273
279
|
}
|
@@ -285,12 +291,15 @@ export async function sendSingleOptimizedTransaction(
|
|
285
291
|
consoleLog("Instructions: ", tx.getInstructions().length);
|
286
292
|
consoleLog("Serialized transaction size: ", tx.getTransactionSize(umi));
|
287
293
|
|
288
|
-
|
294
|
+
let cuPrice = await getComputeUnitPriceEstimate(
|
289
295
|
umi,
|
290
296
|
tx,
|
291
297
|
prioritySetting
|
292
298
|
);
|
293
|
-
|
299
|
+
if (!cuPrice) {
|
300
|
+
cuPrice = 1000000;
|
301
|
+
}
|
302
|
+
consoleLog("Compute unit price: ", cuPrice);
|
294
303
|
|
295
304
|
let computeUnitLimit = undefined;
|
296
305
|
if (txType !== "skip-simulation") {
|
@@ -304,7 +313,7 @@ export async function sendSingleOptimizedTransaction(
|
|
304
313
|
await assembleFinalTransaction(
|
305
314
|
umi.identity,
|
306
315
|
tx,
|
307
|
-
|
316
|
+
cuPrice,
|
308
317
|
1_400_000
|
309
318
|
).setLatestBlockhash(umi)
|
310
319
|
).build(umi)
|
@@ -324,7 +333,7 @@ export async function sendSingleOptimizedTransaction(
|
|
324
333
|
const result = await assembleFinalTransaction(
|
325
334
|
umi.identity,
|
326
335
|
tx,
|
327
|
-
|
336
|
+
cuPrice,
|
328
337
|
computeUnitLimit
|
329
338
|
).sendAndConfirm(umi, {
|
330
339
|
send: {
|
@@ -18,13 +18,13 @@ import {
|
|
18
18
|
} from "../../src/transactions/transactionsManager";
|
19
19
|
import { PublicKey } from "@solana/web3.js";
|
20
20
|
import { USDC_MINT } from "../../src/constants";
|
21
|
-
import { buildHeliusApiUrl } from "../../src/utils";
|
21
|
+
import { buildHeliusApiUrl, getMarginfiAccountPositionState } from "../../src/utils";
|
22
22
|
|
23
23
|
describe("Solauto Marginfi tests", async () => {
|
24
24
|
// const signer = setupTest();
|
25
25
|
const signer = setupTest("solauto-manager");
|
26
26
|
|
27
|
-
const payForTransactions =
|
27
|
+
const payForTransactions = true;
|
28
28
|
const useJitoBundle = false;
|
29
29
|
const positionId = 1;
|
30
30
|
|