@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.
- package/dist/borrow/index.mjs +23 -3
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/borrow/index.mjs
CHANGED
|
@@ -889,9 +889,29 @@ const getCurrentPositionState = async ({
|
|
|
889
889
|
getTick(vaultId, positionTick)
|
|
890
890
|
);
|
|
891
891
|
if (tickData.isLiquidated || tickData.totalIds > position.tickId) {
|
|
892
|
-
|
|
893
|
-
getTickIdLiquidation(
|
|
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