From 613b062e8fb672a5fa5ce735c236d008edf8b1fb Mon Sep 17 00:00:00 2001 From: microwavedcola1 Date: Thu, 30 Mar 2023 09:39:49 +0200 Subject: [PATCH] fix bug where unrealised profit was not abs'ed Signed-off-by: microwavedcola1 --- ts/client/src/accounts/mangoAccount.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/client/src/accounts/mangoAccount.ts b/ts/client/src/accounts/mangoAccount.ts index fbc6ef76d..b63b4bf90 100644 --- a/ts/client/src/accounts/mangoAccount.ts +++ b/ts/client/src/accounts/mangoAccount.ts @@ -1478,7 +1478,7 @@ export class PerpPosition { const baseNative = I80F48.fromI64( this.basePositionLots.mul(perpMarket.baseLotSize), - ); + ).abs(); const positionValue = I80F48.fromNumber( perpMarket.stablePriceModel.stablePrice, )