@jup-ag/lend 0.0.76 → 0.0.77

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,9 +889,29 @@ const getCurrentPositionState = async ({
889
889
  getTick(vaultId, positionTick)
890
890
  );
891
891
  if (tickData.isLiquidated || tickData.totalIds > position.tickId) {
892
- const tickIdData = await program.account.tickIdLiquidation.fetch(
893
- getTickIdLiquidation(vaultId, positionTick, position.tickId)
894
- );
892
+ let tickIdData = await program.account.tickIdLiquidation.fetch(
893
+ getTickIdLiquidation(
894
+ vaultId,
895
+ positionTick,
896
+ position.tickId
897
+ )
898
+ ).catch(() => null);
899
+ if (!tickIdData) {
900
+ tickIdData = {
901
+ vaultId,
902
+ tick: positionTick,
903
+ tickMap: position.tickId,
904
+ isFullyLiquidated1: 0,
905
+ liquidationBranchId1: 0,
906
+ debtFactor1: new BN(0),
907
+ isFullyLiquidated2: 0,
908
+ liquidationBranchId2: 0,
909
+ debtFactor2: new BN(0),
910
+ isFullyLiquidated3: 0,
911
+ liquidationBranchId3: 0,
912
+ debtFactor3: new BN(0)
913
+ };
914
+ }
895
915
  const branches = await getAllBranches({ vaultId, program });
896
916
  const { isFullyLiquidated, branchId, connectionFactor } = getLiquidationStatus(position.tickId, tickData, tickIdData);
897
917
  if (isFullyLiquidated) {
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.76";
11
+ const version = "0.0.77";
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.76",
3
+ "version": "0.0.77",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",