@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.
@@ -20,7 +20,7 @@ class SolautoFeesBps {
20
20
  const k = 1.5;
21
21
  let feeBps = 0;
22
22
  if (this.targetLiqUtilizationRateBps !== undefined) {
23
- feeBps = 15;
23
+ feeBps = 10;
24
24
  }
25
25
  else if (rebalanceDirection === generated_1.RebalanceDirection.Repay) {
26
26
  feeBps = 25;
@@ -1,17 +1,14 @@
1
1
  import { Keypair, PublicKey } from "@solana/web3.js";
2
- import { createSignerFromKeypair, publicKey } from "@metaplex-foundation/umi";
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
- // await client.initializeExistingSolautoPosition({
54
- // positionId: 1,
55
- // authority: new PublicKey("HqpPtE5WbBh3xU9C1Tzz125iYDQyoyodvFCRpwHwQpNc"),
56
- // // lpUserAccount: new PublicKey(
57
- // // "GEokw9jqbh6d1xUNA3qaeYFFetbSR5Y1nt7C3chwwgSz"
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
- // const txManager = new ClientTransactionsManager({
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
- console.log(getTokenAccount(new PublicKey("Gex8CJNhmRFYGkMZJRUAy6Qs7vo57RkX2ejYqD2kanTo"), new PublicKey(JUP)));
73
- console.log(getTokenAccount(new PublicKey("Gex8CJNhmRFYGkMZJRUAy6Qs7vo57RkX2ejYqD2kanTo"), new PublicKey(USDT)));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.758",
3
+ "version": "1.0.759",
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",
@@ -29,7 +29,7 @@ export class SolautoFeesBps {
29
29
 
30
30
  let feeBps: number = 0;
31
31
  if (this.targetLiqUtilizationRateBps !== undefined) {
32
- feeBps = 15;
32
+ feeBps = 10;
33
33
  } else if (rebalanceDirection === RebalanceDirection.Repay) {
34
34
  feeBps = 25;
35
35
  } else if (this.positionNetWorthUsd <= minSize) {