use abs value for notional value

This commit is contained in:
Tyler Shipe 2021-09-02 23:39:24 -04:00
parent 3b59771145
commit dbc66498a9
1 changed files with 4 additions and 2 deletions

View File

@ -175,8 +175,10 @@ export default function MarketPosition() {
<DataLoader />
) : perpAccount ? (
formatUsdValue(
selectedMarket.baseLotsToNumber(perpAccount.basePosition) *
mangoGroup.getPrice(marketIndex, mangoGroupCache).toNumber()
Math.abs(
selectedMarket.baseLotsToNumber(perpAccount.basePosition) *
mangoGroup.getPrice(marketIndex, mangoGroupCache).toNumber()
)
)
) : (
0