@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.
- package/dist/borrow/index.mjs +11 -9
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/borrow/index.mjs
CHANGED
|
@@ -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
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
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,
|
|
1198
|
+
getTickHasDebt(vaultId, topTickIndex - i)
|
|
1197
1199
|
)
|
|
1198
1200
|
)
|
|
1199
1201
|
);
|
package/dist/index.mjs
CHANGED