Skip to content

Commit

Permalink
fix(app): incorrect pnl percent (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
avclarke authored Sep 5, 2023
1 parent 12ca37b commit 1cac220
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/app/src/utils/futures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const updatePositionUpnl = (
.sub(offChainPrice)
.mul(position.side === PositionSide.LONG ? -1 : 1)
)
const pnlPct = pnl.div(position.initialMargin.add(thisPositionHistory.netTransfers))
const pnlPct = pnl.div(thisPositionHistory.initialMargin.add(thisPositionHistory.netTransfers))

Check warning on line 88 in packages/app/src/utils/futures.ts

View check run for this annotation

Codecov / codecov/patch

packages/app/src/utils/futures.ts#L88

Added line #L88 was not covered by tests
const accruedFunding = position.accruedFunding.add(thisPositionHistory.netFunding)

return {
Expand Down

0 comments on commit 1cac220

Please sign in to comment.