Skip to content

Commit 9c6b4b0

Browse files
committed
fix: adjust health getter for user
1 parent 46cc352 commit 9c6b4b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/src/user.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,11 +1530,11 @@ export class User {
15301530
* @returns : number (value from [0, 100])
15311531
*/
15321532
public getHealth(perpMarketIndex?: number): number {
1533-
if (this.isBeingLiquidated() && !perpMarketIndex) {
1533+
const marginCalc = this.getMarginCalculation('Maintenance');
1534+
if (this.isCrossMarginBeingLiquidated(marginCalc) && !perpMarketIndex) {
15341535
return 0;
15351536
}
15361537

1537-
const marginCalc = this.getMarginCalculation('Maintenance');
15381538

15391539
let totalCollateral: BN;
15401540
let maintenanceMarginReq: BN;

0 commit comments

Comments
 (0)