@haven-fi/solauto-sdk 1.0.642 → 1.0.644

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":"marginfiFlProvider.d.ts","sourceRoot":"","sources":["../../../src/services/flashLoans/marginfiFlProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAML,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAclC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAgBlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO,CAAC,wBAAwB,CAAqB;IACrD,OAAO,CAAC,yBAAyB,CAAQ;IACzC,OAAO,CAAC,uBAAuB,CAAQ;IACvC,OAAO,CAAC,iBAAiB,CAAe;IACxC,OAAO,CAAC,eAAe,CAAe;IAEhC,UAAU;YAiBF,iBAAiB;IA6C/B,OAAO,CAAC,sBAAsB;IA0CxB,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAyC3D,gBAAgB,IAAI,SAAS,EAAE;IAY/B,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,WAAW;IAMnB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM;IAI7C,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM;IAc9D,WAAW,CACT,SAAS,EAAE,gBAAgB,EAC3B,gBAAgB,EAAE,SAAS,GAC1B,kBAAkB;IAoCrB,UAAU,CAAC,SAAS,EAAE,gBAAgB,GAAG,kBAAkB;IA0E3D,YAAY,CACV,eAAe,EAAE,SAAS,EAC1B,IAAI,EAAE,SAAS,EACf,aAAa,EAAE,SAAS;CAW3B"}
1
+ {"version":3,"file":"marginfiFlProvider.d.ts","sourceRoot":"","sources":["../../../src/services/flashLoans/marginfiFlProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAML,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAclC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAgBlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO,CAAC,wBAAwB,CAAqB;IACrD,OAAO,CAAC,yBAAyB,CAAQ;IACzC,OAAO,CAAC,uBAAuB,CAAQ;IACvC,OAAO,CAAC,iBAAiB,CAAe;IACxC,OAAO,CAAC,eAAe,CAAe;IAEhC,UAAU;YAiBF,iBAAiB;IA6C/B,OAAO,CAAC,sBAAsB;IA0CxB,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAyC3D,gBAAgB,IAAI,SAAS,EAAE;IAY/B,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,WAAW;IAMnB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM;IAI7C,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM;IAc9D,WAAW,CACT,SAAS,EAAE,gBAAgB,EAC3B,gBAAgB,EAAE,SAAS,GAC1B,kBAAkB;IAwCrB,UAAU,CAAC,SAAS,EAAE,gBAAgB,GAAG,kBAAkB;IA0E3D,YAAY,CACV,eAAe,EAAE,SAAS,EAC1B,IAAI,EAAE,SAAS,EACf,aAAa,EAAE,SAAS;CAW3B"}
@@ -146,6 +146,10 @@ class MarginfiFlProvider extends flProviderBase_1.FlProviderBase {
146
146
  const bank = this.liquidityBank(flashLoan.liquiditySource);
147
147
  const associatedBankAccs = (0, utils_1.findMarginfiAccounts)((0, umi_web3js_adapters_1.toWeb3JsPublicKey)(bank.publicKey));
148
148
  const iMfiAccount = this.iMfiAccount(flashLoan.liquiditySource);
149
+ (0, utils_1.consoleLog)(bank.publicKey.toString());
150
+ (0, utils_1.consoleLog)(associatedBankAccs.liquidityVault.toString());
151
+ (0, utils_1.consoleLog)(associatedBankAccs.vaultAuthority.toString());
152
+ (0, utils_1.consoleLog)(associatedBankAccs.mint.toString());
149
153
  return (0, umi_1.transactionBuilder)()
150
154
  .add((0, marginfi_sdk_1.lendingAccountStartFlashloan)(this.umi, {
151
155
  endIndex: 0, // We set this after building the transaction
@@ -90,7 +90,7 @@ class RebalanceSwapManager {
90
90
  const flashLoanRepayFromDebt = !this.isBoost() &&
91
91
  this.flRequirements &&
92
92
  this.flRequirements.liquiditySource === generated_1.TokenType.Debt;
93
- const exactOut = flashLoanRepayFromDebt && !rebalanceToZero;
93
+ const exactOut = flashLoanRepayFromDebt;
94
94
  const exactIn = !exactOut;
95
95
  if (exactIn && (rebalanceToZero || this.values.repayingCloseToMaxLtv)) {
96
96
  inputAmount = this.bigIntWithIncrement(inputAmount, 0.005);
@@ -109,7 +109,7 @@ class RebalanceSwapManager {
109
109
  exactIn,
110
110
  exactOut,
111
111
  amount: swapAmount,
112
- slippageBps: swappingMeme ? 200 : 50,
112
+ slippageBps: swappingMeme ? 250 : 100,
113
113
  };
114
114
  (0, utils_1.consoleLog)("Swap input:", swapInput);
115
115
  if (exactIn && (rebalanceToZero || this.values.repayingCloseToMaxLtv)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.642",
3
+ "version": "1.0.644",
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",
@@ -253,7 +253,10 @@ export class MarginfiFlProvider extends FlProviderBase {
253
253
  );
254
254
  const iMfiAccount = this.iMfiAccount(flashLoan.liquiditySource)!;
255
255
 
256
- consoleLog(bank.publicKey.toString(), associatedBankAccs);
256
+ consoleLog(bank.publicKey.toString());
257
+ consoleLog(associatedBankAccs.liquidityVault.toString());
258
+ consoleLog(associatedBankAccs.vaultAuthority.toString());
259
+ consoleLog(associatedBankAccs.mint.toString());
257
260
  return transactionBuilder()
258
261
  .add(
259
262
  lendingAccountStartFlashloan(this.umi, {
@@ -148,7 +148,7 @@ export class RebalanceSwapManager {
148
148
  this.flRequirements &&
149
149
  this.flRequirements.liquiditySource === TokenType.Debt;
150
150
 
151
- const exactOut = flashLoanRepayFromDebt && !rebalanceToZero;
151
+ const exactOut = flashLoanRepayFromDebt;
152
152
  const exactIn = !exactOut;
153
153
 
154
154
  if (exactIn && (rebalanceToZero || this.values.repayingCloseToMaxLtv)) {
@@ -174,7 +174,7 @@ export class RebalanceSwapManager {
174
174
  exactIn,
175
175
  exactOut,
176
176
  amount: swapAmount,
177
- slippageBps: swappingMeme ? 200 : 50,
177
+ slippageBps: swappingMeme ? 250 : 100,
178
178
  };
179
179
  consoleLog("Swap input:", swapInput);
180
180