@haven-fi/solauto-sdk 1.0.109 → 1.0.111
Sign up to get free protection for your applications and to get access to all the features.
@@ -119,7 +119,7 @@ async function rebalanceChoresBefore(client, tx, accountsGettingCreated) {
|
|
119
119
|
if (rebalanceInstructions.length === 0) {
|
120
120
|
return (0, umi_1.transactionBuilder)();
|
121
121
|
}
|
122
|
-
const usesAccount = (key) =>
|
122
|
+
const usesAccount = (key) => tx.getInstructions().some((t) => t.keys.some((k) => (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(k.pubkey).equals(key)));
|
123
123
|
const checkReferralSupplyTa = client.referredBySupplyTa && usesAccount(client.referredBySupplyTa);
|
124
124
|
const checkSolautoFeesTa = usesAccount(client.solautoFeesSupplyTa);
|
125
125
|
const checkIntermediaryMfiAccount = client.lendingPlatform === generated_1.LendingPlatform.Marginfi &&
|
@@ -32,7 +32,7 @@ async function getJupSwapTransaction(signer, swapDetails, attemptNum) {
|
|
32
32
|
? "ExactIn"
|
33
33
|
: undefined,
|
34
34
|
slippageBps: 10,
|
35
|
-
maxAccounts: 60,
|
35
|
+
maxAccounts: !swapDetails.exactOut ? 60 : undefined,
|
36
36
|
}), 3);
|
37
37
|
const finalPriceSlippageBps = Math.round(Math.max(50, quoteResponse.slippageBps, Math.round((0, numberUtils_1.toBps)(parseFloat(quoteResponse.priceImpactPct))) + 1) *
|
38
38
|
(1 + (swapDetails.slippageBpsIncFactor ?? 0)));
|
package/package.json
CHANGED
@@ -235,10 +235,10 @@ export async function rebalanceChoresBefore(
|
|
235
235
|
}
|
236
236
|
|
237
237
|
const usesAccount = (key: PublicKey) =>
|
238
|
-
|
238
|
+
tx.getInstructions().some((t) =>
|
239
239
|
t.keys.some((k) => toWeb3JsPublicKey(k.pubkey).equals(key))
|
240
240
|
);
|
241
|
-
|
241
|
+
|
242
242
|
const checkReferralSupplyTa =
|
243
243
|
client.referredBySupplyTa && usesAccount(client.referredBySupplyTa);
|
244
244
|
const checkSolautoFeesTa = usesAccount(client.solautoFeesSupplyTa);
|
@@ -20,12 +20,12 @@ import { PublicKey } from "@solana/web3.js";
|
|
20
20
|
import { USDC_MINT } from "../../src/constants";
|
21
21
|
|
22
22
|
describe("Solauto Marginfi tests", async () => {
|
23
|
-
|
24
|
-
const signer = setupTest("solauto-manager");
|
23
|
+
const signer = setupTest();
|
24
|
+
// const signer = setupTest("solauto-manager");
|
25
25
|
|
26
26
|
const payForTransactions = false;
|
27
27
|
const useJitoBundle = false;
|
28
|
-
const positionId =
|
28
|
+
const positionId = 1;
|
29
29
|
|
30
30
|
it("open - deposit - borrow - rebalance to 0 - withdraw - close", async () => {
|
31
31
|
|
@@ -39,7 +39,7 @@ describe("Solauto Marginfi tests", async () => {
|
|
39
39
|
{
|
40
40
|
signer,
|
41
41
|
positionId,
|
42
|
-
authority: new PublicKey("92xmP49BQycn3t2HkGxLAweN3jjrExxSNpywA3xF7mYY")
|
42
|
+
// authority: new PublicKey("92xmP49BQycn3t2HkGxLAweN3jjrExxSNpywA3xF7mYY")
|
43
43
|
// marginfiAccount: new PublicKey(
|
44
44
|
// "4nNvUXF5YqHFcH2nGweSiuvy1ct7V5FXfoCLKFYUN36z"
|
45
45
|
// ),
|
@@ -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,
|
126
|
+
await buildSolautoRebalanceTransaction(client, 1500, attemptNum),
|
127
127
|
"rebalance"
|
128
128
|
)
|
129
129
|
);
|