@jup-ag/lend 0.0.88 → 0.0.90

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.
@@ -889,13 +889,16 @@ const getCurrentPositionState = async ({
889
889
  getTick(vaultId, positionTick)
890
890
  );
891
891
  if (tickData.isLiquidated || tickData.totalIds > position.tickId) {
892
- let tickIdData = await program.account.tickIdLiquidation.fetch(
893
- getTickIdLiquidation(
894
- vaultId,
895
- positionTick,
896
- position.tickId
897
- )
898
- ).catch(() => null);
892
+ let [tickIdData, branches] = await Promise.all([
893
+ program.account.tickIdLiquidation.fetch(
894
+ getTickIdLiquidation(
895
+ vaultId,
896
+ positionTick,
897
+ position.tickId
898
+ )
899
+ ).catch(() => null),
900
+ getAllBranches({ vaultId, program })
901
+ ]);
899
902
  if (!tickIdData) {
900
903
  tickIdData = {
901
904
  vaultId,
@@ -912,7 +915,6 @@ const getCurrentPositionState = async ({
912
915
  debtFactor3: new BN(0)
913
916
  };
914
917
  }
915
- const branches = await getAllBranches({ vaultId, program });
916
918
  const { isFullyLiquidated, branchId, connectionFactor } = getLiquidationStatus(position.tickId, tickData, tickIdData);
917
919
  if (isFullyLiquidated) {
918
920
  return {
@@ -1193,7 +1195,7 @@ async function loadRelevantTicksHasDebtArrays(vaultId, topTick, program) {
1193
1195
  Array.from(
1194
1196
  { length: topTickIndex },
1195
1197
  (_, i) => program.account.tickHasDebtArray.fetch(
1196
- getTickHasDebt(vaultId, 15 - i)
1198
+ getTickHasDebt(vaultId, topTickIndex - i)
1197
1199
  )
1198
1200
  )
1199
1201
  );
package/dist/index.mjs CHANGED
@@ -8,6 +8,6 @@ import './shared/lend.CioR9-te.mjs';
8
8
  import '@solana/spl-token';
9
9
  import 'bn.js';
10
10
 
11
- const version = "0.0.88";
11
+ const version = "0.0.90";
12
12
 
13
13
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jup-ag/lend",
3
- "version": "0.0.88",
3
+ "version": "0.0.90",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",