@haven-fi/solauto-sdk 1.0.748 → 1.0.749
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.
- package/dist/constants/solautoConstants.d.ts +2 -0
- package/dist/constants/solautoConstants.d.ts.map +1 -1
- package/dist/constants/solautoConstants.js +13 -1
- package/dist/services/solauto/solautoClient.d.ts.map +1 -1
- package/dist/services/solauto/solautoClient.js +3 -0
- package/local/patchLUT.ts +93 -0
- package/local/shared.ts +1 -0
- package/local/txSandbox.ts +28 -37
- package/package.json +1 -1
- package/src/constants/solautoConstants.ts +13 -0
- package/src/services/solauto/solautoClient.ts +11 -1
- package/src/utils/solautoUtils.ts +1 -1
@@ -20,5 +20,7 @@ export declare const CHORES_TX_NAME = "account chores";
|
|
20
20
|
export declare const JITO_TIP_ACCOUNTS: string[];
|
21
21
|
export declare const SOLAUTO_LUT = "8b7KefQDroVLGao71J5H3hFwABeyMCgCrLpXWssNFhk9";
|
22
22
|
export declare const STANDARD_LUT_ACCOUNTS: string[];
|
23
|
+
export declare const PATCH_LUT = "CmPZfu3tkeoMutytxhVKT7Hemuwd5jM65VdLNGdBddxQ";
|
24
|
+
export declare const AUTHORITIES_REQUIRING_PATCH_LUT: string[];
|
23
25
|
export {};
|
24
26
|
//# sourceMappingURL=solautoConstants.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solautoConstants.d.ts","sourceRoot":"","sources":["../../src/constants/solautoConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EACV,MAAM,iBAAiB,CAAC;AAQzB,eAAO,MAAM,oBAAoB,WAEhC,CAAC;AACF,eAAO,MAAM,oBAAoB,WAEhC,CAAC;AAIF,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,eA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iDAAiD,CAAC;AAC1E,eAAO,MAAM,qBAAqB,UAYR,CAAC;AAG3B,eAAO,MAAM,SAAS,iDAAiD,CAAC;AACxE,eAAO,MAAM,+BAA+B,UAS3C,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.STANDARD_LUT_ACCOUNTS = exports.SOLAUTO_LUT = exports.JITO_TIP_ACCOUNTS = exports.CHORES_TX_NAME = exports.PRICES = exports.REFERRER_PERCENTAGE = exports.OFFSET_FROM_MAX_LTV = exports.MIN_USD_SUPPORTED_POSITION = exports.MIN_BOOST_GAP_BPS = exports.MIN_REPAY_GAP_BPS = exports.SOLAUTO_TEST_PROGRAM = exports.SOLAUTO_PROD_PROGRAM = void 0;
|
3
|
+
exports.AUTHORITIES_REQUIRING_PATCH_LUT = exports.PATCH_LUT = exports.STANDARD_LUT_ACCOUNTS = exports.SOLAUTO_LUT = exports.JITO_TIP_ACCOUNTS = exports.CHORES_TX_NAME = exports.PRICES = exports.REFERRER_PERCENTAGE = exports.OFFSET_FROM_MAX_LTV = exports.MIN_USD_SUPPORTED_POSITION = exports.MIN_BOOST_GAP_BPS = exports.MIN_REPAY_GAP_BPS = exports.SOLAUTO_TEST_PROGRAM = exports.SOLAUTO_PROD_PROGRAM = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
const spl_token_1 = require("@solana/spl-token");
|
6
6
|
const generalConstants_1 = require("./generalConstants");
|
@@ -39,3 +39,15 @@ exports.STANDARD_LUT_ACCOUNTS = [
|
|
39
39
|
web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
|
40
40
|
jupiter_sdk_1.JUPITER_PROGRAM_ID,
|
41
41
|
].map((x) => x.toString());
|
42
|
+
// TODO: remove me
|
43
|
+
exports.PATCH_LUT = "CmPZfu3tkeoMutytxhVKT7Hemuwd5jM65VdLNGdBddxQ";
|
44
|
+
exports.AUTHORITIES_REQUIRING_PATCH_LUT = [
|
45
|
+
"5UqsR2PGzbP8pGPbXEeXx86Gjz2N2UFBAuFZUSVydAEe",
|
46
|
+
"F2uk8zsKMex8MztU7saFNq6tNbj4esWnKLJXyfo2egax",
|
47
|
+
"8Vo5ScTZ1qNTYhMEibq2fekRe5DotmdqpcD2nprmRzJg",
|
48
|
+
"HLDgPtVv2Yyzzze462P89igFnyLxaCM3f9hVFmCuAX97",
|
49
|
+
"48CDX2mhhj9iAZthMWJKHFV9wvii9cxzDdtQKuAVwqEu",
|
50
|
+
"BRgwGasCSz1zA4yqdcvurAGV7ZroAJ9bvDNvdYj7az4X",
|
51
|
+
"9PCRbk8Gvt2zqewLKbxaSyTxA2JMtdQGhMff8EdELXNq",
|
52
|
+
"C4cnE5kDRRnqfiLuWShvoGNDstq6yk91N2PWTxQ6Hmk2",
|
53
|
+
];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solautoClient.d.ts","sourceRoot":"","sources":["../../../src/services/solauto/solautoClient.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAA6B,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EACL,kBAAkB,EAMnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,gCAAgC,EAEhC,sBAAsB,EAGvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAKL,cAAc,EACf,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"solautoClient.d.ts","sourceRoot":"","sources":["../../../src/services/solauto/solautoClient.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAA6B,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EACL,kBAAkB,EAMnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,YA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AY,GAC1B,kBAAkB;IA0BrB,gBAAgB,CAAC,IAAI,EAAE,sBAAsB,GAAG,kBAAkB;IAsDlE,QAAQ,CAAC,eAAe,IAAI,kBAAkB;IAE9C,WAAW,IAAI,kBAAkB;IAcjC,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,kBAAkB;IAE7D,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,GAAG,kBAAkB;IAqFlE,QAAQ,CAAC,WAAW,CAClB,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,gBAAgB,GACrB,kBAAkB;CACtB"}
|
@@ -93,6 +93,9 @@ class SolautoClient extends referralStateManager_1.ReferralStateManager {
|
|
93
93
|
...(this.authorityLutAddress
|
94
94
|
? [this.authorityLutAddress.toString()]
|
95
95
|
: []),
|
96
|
+
...(constants_1.AUTHORITIES_REQUIRING_PATCH_LUT.includes(this.pos.authority.toString())
|
97
|
+
? [constants_1.PATCH_LUT]
|
98
|
+
: []),
|
96
99
|
];
|
97
100
|
}
|
98
101
|
lutAccountsToAdd() {
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import {
|
2
|
+
fromWeb3JsPublicKey,
|
3
|
+
toWeb3JsPublicKey,
|
4
|
+
} from "@metaplex-foundation/umi-web3js-adapters";
|
5
|
+
import {
|
6
|
+
fetchAllReferralState,
|
7
|
+
getPositionExBulk,
|
8
|
+
getReferralState,
|
9
|
+
getSolanaRpcConnection,
|
10
|
+
getSolautoManagedPositions,
|
11
|
+
getTokenAccount,
|
12
|
+
LOCAL_IRONFORGE_API_URL,
|
13
|
+
PATCH_LUT,
|
14
|
+
SOLAUTO_PROD_PROGRAM,
|
15
|
+
} from "../src";
|
16
|
+
import { PublicKey } from "@solana/web3.js";
|
17
|
+
import { updateLookupTable } from "./shared";
|
18
|
+
|
19
|
+
let [conn, umi] = getSolanaRpcConnection(
|
20
|
+
LOCAL_IRONFORGE_API_URL,
|
21
|
+
SOLAUTO_PROD_PROGRAM
|
22
|
+
);
|
23
|
+
|
24
|
+
async function getMissingAccounts() {
|
25
|
+
const allMissingAccounts: string[] = [];
|
26
|
+
const allPositions = await getSolautoManagedPositions(umi);
|
27
|
+
const positions = await getPositionExBulk(
|
28
|
+
umi,
|
29
|
+
allPositions.map((x) => x.publicKey!)
|
30
|
+
);
|
31
|
+
|
32
|
+
const referralStates = positions.map((x) =>
|
33
|
+
getReferralState(
|
34
|
+
x.authority,
|
35
|
+
toWeb3JsPublicKey(umi.programs.get("solauto").publicKey)
|
36
|
+
)
|
37
|
+
);
|
38
|
+
const referralStatesData = await fetchAllReferralState(
|
39
|
+
umi,
|
40
|
+
referralStates.map((x) => fromWeb3JsPublicKey(x))
|
41
|
+
);
|
42
|
+
|
43
|
+
const users = Array.from(
|
44
|
+
new Set(positions.map((x) => x.authority.toString()))
|
45
|
+
);
|
46
|
+
for (const user of users) {
|
47
|
+
const authority = new PublicKey(user);
|
48
|
+
const referralState = referralStatesData.find((x) =>
|
49
|
+
toWeb3JsPublicKey(x.authority).equals(authority)
|
50
|
+
)!;
|
51
|
+
const lookupTable = referralState.lookupTable;
|
52
|
+
|
53
|
+
const existingUserLUTAccounts =
|
54
|
+
(
|
55
|
+
await conn.getAddressLookupTable(toWeb3JsPublicKey(lookupTable), {
|
56
|
+
commitment: "confirmed",
|
57
|
+
})
|
58
|
+
).value?.state?.addresses ?? [];
|
59
|
+
|
60
|
+
const userPositions = positions.filter((x) =>
|
61
|
+
x.authority.equals(authority)
|
62
|
+
);
|
63
|
+
|
64
|
+
let requiredAccounts = userPositions.flatMap((x) => {
|
65
|
+
return [
|
66
|
+
getTokenAccount(authority, x.supplyMint),
|
67
|
+
getTokenAccount(authority, x.debtMint),
|
68
|
+
x.publicKey,
|
69
|
+
x.lpUserAccount!,
|
70
|
+
getTokenAccount(x.publicKey, x.supplyMint),
|
71
|
+
getTokenAccount(x.publicKey, x.debtMint),
|
72
|
+
].map((x) => x.toString());
|
73
|
+
});
|
74
|
+
requiredAccounts = Array.from(new Set(requiredAccounts));
|
75
|
+
|
76
|
+
const missingAccounts = requiredAccounts.filter(
|
77
|
+
(x) =>
|
78
|
+
existingUserLUTAccounts.find((y) => y.toString() === x) === undefined
|
79
|
+
);
|
80
|
+
|
81
|
+
if (missingAccounts.length) {
|
82
|
+
console.log("\nMissing accounts for", referralState.publicKey.toString());
|
83
|
+
console.log(missingAccounts);
|
84
|
+
allMissingAccounts.push(...missingAccounts);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
return allMissingAccounts;
|
89
|
+
}
|
90
|
+
|
91
|
+
getMissingAccounts().then(async (accs) => {
|
92
|
+
await updateLookupTable(accs, new PublicKey(PATCH_LUT));
|
93
|
+
});
|
package/local/shared.ts
CHANGED
@@ -110,6 +110,7 @@ export async function updateLookupTable(
|
|
110
110
|
lookupTableAddress = addr;
|
111
111
|
console.log("Lookup Table Address:", lookupTableAddress.toString());
|
112
112
|
await createAndSendV0Tx([createLutIx], keypair);
|
113
|
+
CACHE[lookupTableAddress.toString()] = [];
|
113
114
|
}
|
114
115
|
|
115
116
|
const existingAccounts = CACHE[lookupTableAddress.toString()];
|
package/local/txSandbox.ts
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
import { Keypair, PublicKey } from "@solana/web3.js";
|
2
2
|
import { createSignerFromKeypair } from "@metaplex-foundation/umi";
|
3
|
-
import { fromWeb3JsKeypair
|
3
|
+
import { fromWeb3JsKeypair } from "@metaplex-foundation/umi-web3js-adapters";
|
4
4
|
import {
|
5
5
|
ClientTransactionsManager,
|
6
6
|
consoleLog,
|
7
|
-
fetchReferralState,
|
8
7
|
getBatches,
|
9
8
|
getClient,
|
10
9
|
getPositionExBulk,
|
11
|
-
getReferralState,
|
12
10
|
getSolanaRpcConnection,
|
13
11
|
getSolautoManagedPositions,
|
14
12
|
LendingPlatform,
|
@@ -28,7 +26,7 @@ const payForTransaction = false;
|
|
28
26
|
const testProgram = false;
|
29
27
|
const lpEnv: ProgramEnv = "Prod";
|
30
28
|
|
31
|
-
let [
|
29
|
+
let [, umi] = getSolanaRpcConnection(
|
32
30
|
LOCAL_IRONFORGE_API_URL,
|
33
31
|
testProgram ? SOLAUTO_TEST_PROGRAM : SOLAUTO_PROD_PROGRAM,
|
34
32
|
lpEnv
|
@@ -40,39 +38,32 @@ const signer = createSignerFromKeypair(
|
|
40
38
|
);
|
41
39
|
|
42
40
|
export async function main() {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
const ref = getReferralState(new PublicKey("9PCRbk8Gvt2zqewLKbxaSyTxA2JMtdQGhMff8EdELXNq"), SOLAUTO_PROD_PROGRAM);
|
71
|
-
|
72
|
-
const data = await fetchReferralState(umi, fromWeb3JsPublicKey(ref));
|
73
|
-
|
74
|
-
const accounts = await conn.getAddressLookupTable(new PublicKey(data.lookupTable));
|
75
|
-
console.log(accounts.value?.state?.addresses);
|
41
|
+
const client = getClient(LendingPlatform.Marginfi, {
|
42
|
+
signer,
|
43
|
+
showLogs: true,
|
44
|
+
rpcUrl: LOCAL_IRONFORGE_API_URL,
|
45
|
+
programId: testProgram ? SOLAUTO_TEST_PROGRAM : SOLAUTO_PROD_PROGRAM,
|
46
|
+
lpEnv,
|
47
|
+
});
|
48
|
+
|
49
|
+
await client.initializeExistingSolautoPosition({
|
50
|
+
positionId: 2,
|
51
|
+
authority: new PublicKey("EBhRj7jbF2EVE21i19JSuCX1BAbnZFYhoKW64HnaZ3kf"),
|
52
|
+
// lpUserAccount: new PublicKey(
|
53
|
+
// "GEokw9jqbh6d1xUNA3qaeYFFetbSR5Y1nt7C3chwwgSz"
|
54
|
+
// ),
|
55
|
+
});
|
56
|
+
|
57
|
+
const transactionItems = [rebalance(client)];
|
58
|
+
|
59
|
+
const txManager = new ClientTransactionsManager({
|
60
|
+
txHandler: client,
|
61
|
+
txRunType: payForTransaction ? "normal" : "only-simulate",
|
62
|
+
priorityFeeSetting: PriorityFeeSetting.Default,
|
63
|
+
retryConfig: { totalRetries: 2 },
|
64
|
+
});
|
65
|
+
const statuses = await txManager.send(transactionItems);
|
66
|
+
consoleLog(statuses);
|
76
67
|
}
|
77
68
|
|
78
69
|
async function refreshAll() {
|
package/package.json
CHANGED
@@ -65,3 +65,16 @@ export const STANDARD_LUT_ACCOUNTS = [
|
|
65
65
|
SYSVAR_INSTRUCTIONS_PUBKEY,
|
66
66
|
JUPITER_PROGRAM_ID,
|
67
67
|
].map((x) => x.toString());
|
68
|
+
|
69
|
+
// TODO: remove me
|
70
|
+
export const PATCH_LUT = "CmPZfu3tkeoMutytxhVKT7Hemuwd5jM65VdLNGdBddxQ";
|
71
|
+
export const AUTHORITIES_REQUIRING_PATCH_LUT = [
|
72
|
+
"5UqsR2PGzbP8pGPbXEeXx86Gjz2N2UFBAuFZUSVydAEe",
|
73
|
+
"F2uk8zsKMex8MztU7saFNq6tNbj4esWnKLJXyfo2egax",
|
74
|
+
"8Vo5ScTZ1qNTYhMEibq2fekRe5DotmdqpcD2nprmRzJg",
|
75
|
+
"HLDgPtVv2Yyzzze462P89igFnyLxaCM3f9hVFmCuAX97",
|
76
|
+
"48CDX2mhhj9iAZthMWJKHFV9wvii9cxzDdtQKuAVwqEu",
|
77
|
+
"BRgwGasCSz1zA4yqdcvurAGV7ZroAJ9bvDNvdYj7az4X",
|
78
|
+
"9PCRbk8Gvt2zqewLKbxaSyTxA2JMtdQGhMff8EdELXNq",
|
79
|
+
"C4cnE5kDRRnqfiLuWShvoGNDstq6yk91N2PWTxQ6Hmk2",
|
80
|
+
];
|
@@ -29,7 +29,12 @@ import {
|
|
29
29
|
splTokenTransferUmiIx,
|
30
30
|
ContextUpdates,
|
31
31
|
} from "../../utils";
|
32
|
-
import {
|
32
|
+
import {
|
33
|
+
AUTHORITIES_REQUIRING_PATCH_LUT,
|
34
|
+
PATCH_LUT,
|
35
|
+
SOLAUTO_FEES_WALLET,
|
36
|
+
SOLAUTO_LUT,
|
37
|
+
} from "../../constants";
|
33
38
|
import { ProgramEnv, RebalanceDetails } from "../../types";
|
34
39
|
import {
|
35
40
|
ReferralStateManager,
|
@@ -221,6 +226,11 @@ export abstract class SolautoClient extends ReferralStateManager {
|
|
221
226
|
...(this.authorityLutAddress
|
222
227
|
? [this.authorityLutAddress.toString()]
|
223
228
|
: []),
|
229
|
+
...(AUTHORITIES_REQUIRING_PATCH_LUT.includes(
|
230
|
+
this.pos.authority.toString()
|
231
|
+
)
|
232
|
+
? [PATCH_LUT]
|
233
|
+
: []),
|
224
234
|
];
|
225
235
|
}
|
226
236
|
|
@@ -19,7 +19,7 @@ import {
|
|
19
19
|
getSolautoPositionAccountDataSerializer,
|
20
20
|
getSolautoPositionSize,
|
21
21
|
} from "../generated";
|
22
|
-
import {
|
22
|
+
import { SOLAUTO_PROD_PROGRAM } from "../constants";
|
23
23
|
import { SolautoPositionDetails } from "../types";
|
24
24
|
import {
|
25
25
|
SolautoClient,
|