Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 7a26a4b

Browse files
authored
Merge pull request #62 from Parifi/fix/minor-bug-liq
Fix/minor bug for liquidation price calculation
2 parents b97ed86 + 197d2b8 commit 7a26a4b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@parifi/synthetix-sdk-ts",
3-
"version": "0.4.34",
3+
"version": "0.4.35",
44
"description": "A Typescript SDK for interactions with the Synthetix protocol",
55
"files": [
66
"dist",

src/perps/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ export class Perps extends Market<MarketData> implements PerpsRepository {
12391239
// For invalid position, return current market price
12401240
if (positionSize == 0) return { healthFactor, liquidationPrice: indexPrice };
12411241

1242-
const lossPerToken = (requiredMaintenanceMargin - availableMargin) / positionSize;
1242+
const lossPerToken = Math.abs((requiredMaintenanceMargin - availableMargin) / positionSize);
12431243

12441244
let liquidationPrice;
12451245
if (positionSize > 0) {

0 commit comments

Comments
 (0)