@haven-fi/solauto-sdk 1.0.758 → 1.0.759
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/local/txSandbox.ts
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
import { Keypair, PublicKey } from "@solana/web3.js";
|
2
|
-
import { createSignerFromKeypair
|
2
|
+
import { createSignerFromKeypair } from "@metaplex-foundation/umi";
|
3
3
|
import { fromWeb3JsKeypair } from "@metaplex-foundation/umi-web3js-adapters";
|
4
4
|
import {
|
5
5
|
ClientTransactionsManager,
|
6
6
|
consoleLog,
|
7
|
-
fetchSolautoPosition,
|
8
7
|
getBatches,
|
9
8
|
getClient,
|
10
9
|
getPositionExBulk,
|
11
10
|
getSolanaRpcConnection,
|
12
11
|
getSolautoManagedPositions,
|
13
|
-
getTokenAccount,
|
14
|
-
JUP,
|
15
12
|
LendingPlatform,
|
16
13
|
LOCAL_IRONFORGE_API_URL,
|
17
14
|
PriceType,
|
@@ -22,7 +19,6 @@ import {
|
|
22
19
|
SOLAUTO_TEST_PROGRAM,
|
23
20
|
SolautoClient,
|
24
21
|
TransactionItem,
|
25
|
-
USDT,
|
26
22
|
} from "../src";
|
27
23
|
import { getSecretKey } from "./shared";
|
28
24
|
|
@@ -50,27 +46,24 @@ export async function main() {
|
|
50
46
|
lpEnv,
|
51
47
|
});
|
52
48
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
// const transactionItems = [rebalance(client, undefined, 150)];
|
49
|
+
await client.initializeExistingSolautoPosition({
|
50
|
+
positionId: 2,
|
51
|
+
authority: new PublicKey("EBhRj7jbF2EVE21i19JSuCX1BAbnZFYhoKW64HnaZ3kf"),
|
52
|
+
// lpUserAccount: new PublicKey(
|
53
|
+
// "GEokw9jqbh6d1xUNA3qaeYFFetbSR5Y1nt7C3chwwgSz"
|
54
|
+
// ),
|
55
|
+
});
|
62
56
|
|
63
|
-
|
64
|
-
// txHandler: client,
|
65
|
-
// txRunType: payForTransaction ? "normal" : "only-simulate",
|
66
|
-
// priorityFeeSetting: PriorityFeeSetting.Default,
|
67
|
-
// retryConfig: { totalRetries: 2 },
|
68
|
-
// });
|
69
|
-
// const statuses = await txManager.send(transactionItems);
|
70
|
-
// consoleLog(statuses);
|
57
|
+
const transactionItems = [rebalance(client)];
|
71
58
|
|
72
|
-
|
73
|
-
|
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);
|
74
67
|
}
|
75
68
|
|
76
69
|
async function refreshAll() {
|
package/package.json
CHANGED
@@ -29,7 +29,7 @@ export class SolautoFeesBps {
|
|
29
29
|
|
30
30
|
let feeBps: number = 0;
|
31
31
|
if (this.targetLiqUtilizationRateBps !== undefined) {
|
32
|
-
feeBps =
|
32
|
+
feeBps = 10;
|
33
33
|
} else if (rebalanceDirection === RebalanceDirection.Repay) {
|
34
34
|
feeBps = 25;
|
35
35
|
} else if (this.positionNetWorthUsd <= minSize) {
|