diff --git a/package.json b/package.json index a6a92dff5..9e46e2836 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "build": "npm run build:esm; npm run build:cjs", "build:cjs": "tsc -p tsconfig.cjs.json", "build:esm": "tsc -p tsconfig.esm.json", + "test": "ts-mocha ts/client/**/*.spec.ts", "clean": "rm -rf dist", "example1-user": "ts-node ts/client/src/scripts/example1-user.ts", "example1-admin": "ts-node ts/client/src/scripts/example1-admin.ts", diff --git a/ts/client/src/accounts/healthCache.ts b/ts/client/src/accounts/healthCache.ts index 703a987c4..6762ab45e 100644 --- a/ts/client/src/accounts/healthCache.ts +++ b/ts/client/src/accounts/healthCache.ts @@ -173,7 +173,7 @@ export class HealthCache { } } - if (liabs.isPos()) { + if (liabs.gt(I80F48.fromNumber(0.001))) { return HUNDRED_I80F48().mul(assets.sub(liabs).div(liabs)); } else { return MAX_I80F48();