@haven-fi/solauto-sdk 1.0.754 → 1.0.756

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.
@@ -1 +1 @@
1
- {"version":3,"file":"rebalanceTxBuilder.d.ts","sourceRoot":"","sources":["../../../src/services/rebalance/rebalanceTxBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAGL,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAgCrB,qBAAa,kBAAkB;IAQ3B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,2BAA2B,CAAC;IACpC,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,wBAAwB,CAAC;IAVnC,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,cAAc,CAAC,CAAwB;IAC/C,OAAO,CAAC,SAAS,CAAiC;gBAGxC,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,YAAA,EACpC,YAAY,CAAC,EAAE,OAAO,YAAA,EACtB,wBAAwB,CAAC,EAAE,MAAM,YAAA;IAG3C,OAAO,CAAC,0BAA0B;IAclC,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,oBAAoB;IAyC5B,OAAO,CAAC,iCAAiC;YAgC3B,qBAAqB;IA4CnC,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,gBAAgB;IA+BxB,OAAO,CAAC,yBAAyB;YAqBnB,mBAAmB;YAyBnB,sBAAsB;YAyBtB,mBAAmB;IAsFpB,gBAAgB,CAC3B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;CAe9C"}
1
+ {"version":3,"file":"rebalanceTxBuilder.d.ts","sourceRoot":"","sources":["../../../src/services/rebalance/rebalanceTxBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAGL,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAgCrB,qBAAa,kBAAkB;IAQ3B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,2BAA2B,CAAC;IACpC,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,wBAAwB,CAAC;IAVnC,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,cAAc,CAAC,CAAwB;IAC/C,OAAO,CAAC,SAAS,CAAiC;gBAGxC,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,YAAA,EACpC,YAAY,CAAC,EAAE,OAAO,YAAA,EACtB,wBAAwB,CAAC,EAAE,MAAM,YAAA;IAG3C,OAAO,CAAC,0BAA0B;IAclC,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,oBAAoB;IAyC5B,OAAO,CAAC,iCAAiC;YAgC3B,qBAAqB;IAmDnC,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,gBAAgB;IA+BxB,OAAO,CAAC,yBAAyB;YAqBnB,mBAAmB;YAyBnB,sBAAsB;YAyBtB,mBAAmB;IAsFpB,gBAAgB,CAC3B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;CAe9C"}
@@ -71,9 +71,12 @@ class RebalanceTxBuilder {
71
71
  return undefined;
72
72
  }
73
73
  const stdFlLiquiditySource = this.getFlLiquiditySource(attemptNum, this.client.flProvider.liquidityAvailable(generated_1.TokenType.Supply), this.client.flProvider.liquidityAvailable(generated_1.TokenType.Debt));
74
+ console.log(this.client.flProvider.liquidityAvailable(generated_1.TokenType.Supply), this.client.flProvider.liquidityAvailable(generated_1.TokenType.Debt));
75
+ console.log("std", stdFlLiquiditySource);
74
76
  if (stdFlLiquiditySource === undefined || this.optimizeSize) {
75
77
  const { supplyBalance, debtBalance } = await this.client.signerBalances();
76
78
  const signerFlLiquiditySource = this.getFlLiquiditySource(attemptNum, supplyBalance, debtBalance);
79
+ console.log("signer", signerFlLiquiditySource);
77
80
  if (signerFlLiquiditySource) {
78
81
  return {
79
82
  liquiditySource: signerFlLiquiditySource,
@@ -1,14 +1,17 @@
1
1
  import { Keypair, PublicKey } from "@solana/web3.js";
2
- import { createSignerFromKeypair } from "@metaplex-foundation/umi";
2
+ import { createSignerFromKeypair, publicKey } 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,
7
8
  getBatches,
8
9
  getClient,
9
10
  getPositionExBulk,
10
11
  getSolanaRpcConnection,
11
12
  getSolautoManagedPositions,
13
+ getTokenAccount,
14
+ JUP,
12
15
  LendingPlatform,
13
16
  LOCAL_IRONFORGE_API_URL,
14
17
  PriceType,
@@ -19,6 +22,7 @@ import {
19
22
  SOLAUTO_TEST_PROGRAM,
20
23
  SolautoClient,
21
24
  TransactionItem,
25
+ USDT,
22
26
  } from "../src";
23
27
  import { getSecretKey } from "./shared";
24
28
 
@@ -46,24 +50,27 @@ export async function main() {
46
50
  lpEnv,
47
51
  });
48
52
 
49
- await client.initializeExistingSolautoPosition({
50
- positionId: 2,
51
- authority: new PublicKey("EBhRj7jbF2EVE21i19JSuCX1BAbnZFYhoKW64HnaZ3kf"),
52
- // lpUserAccount: new PublicKey(
53
- // "GEokw9jqbh6d1xUNA3qaeYFFetbSR5Y1nt7C3chwwgSz"
54
- // ),
55
- });
53
+ // await client.initializeExistingSolautoPosition({
54
+ // positionId: 1,
55
+ // authority: new PublicKey("HqpPtE5WbBh3xU9C1Tzz125iYDQyoyodvFCRpwHwQpNc"),
56
+ // // lpUserAccount: new PublicKey(
57
+ // // "GEokw9jqbh6d1xUNA3qaeYFFetbSR5Y1nt7C3chwwgSz"
58
+ // // ),
59
+ // });
56
60
 
57
- const transactionItems = [rebalance(client)];
61
+ // const transactionItems = [rebalance(client, undefined, 150)];
58
62
 
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);
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);
71
+
72
+ console.log(getTokenAccount(new PublicKey("Gex8CJNhmRFYGkMZJRUAy6Qs7vo57RkX2ejYqD2kanTo"), new PublicKey(JUP)));
73
+ console.log(getTokenAccount(new PublicKey("Gex8CJNhmRFYGkMZJRUAy6Qs7vo57RkX2ejYqD2kanTo"), new PublicKey(USDT)));
67
74
  }
68
75
 
69
76
  async function refreshAll() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.754",
3
+ "version": "1.0.756",
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",
@@ -174,6 +174,12 @@ export class RebalanceTxBuilder {
174
174
  this.client.flProvider.liquidityAvailable(TokenType.Debt)
175
175
  );
176
176
 
177
+ console.log(
178
+ this.client.flProvider.liquidityAvailable(TokenType.Supply),
179
+ this.client.flProvider.liquidityAvailable(TokenType.Debt)
180
+ );
181
+ console.log("std", stdFlLiquiditySource);
182
+
177
183
  if (stdFlLiquiditySource === undefined || this.optimizeSize) {
178
184
  const { supplyBalance, debtBalance } = await this.client.signerBalances();
179
185
  const signerFlLiquiditySource = this.getFlLiquiditySource(
@@ -182,6 +188,7 @@ export class RebalanceTxBuilder {
182
188
  debtBalance
183
189
  );
184
190
 
191
+ console.log("signer", signerFlLiquiditySource)
185
192
  if (signerFlLiquiditySource) {
186
193
  return {
187
194
  liquiditySource: signerFlLiquiditySource,