Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrealized PnL wrong or confusing. #2426

Open
Boibit opened this issue May 24, 2024 · 2 comments
Open

Unrealized PnL wrong or confusing. #2426

Boibit opened this issue May 24, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Boibit
Copy link

Boibit commented May 24, 2024

image

Smashball is the reported outcome of this market but I have negative unrealized PnL for the position in my portfolio.

Not sure if this is calculating total PnL of the entire market. I did have positions that were sold for a loss or held to 0 in the same market. If this is calculating the total PnL of the market, then it's confusing and counter intuitive. If not, this is a bug.

@Robiquet Robiquet added the bug Something isn't working label May 28, 2024
@Robiquet
Copy link
Member

Maybe because price is incorrect

@robhyrk robhyrk self-assigned this Jun 3, 2024
@robhyrk
Copy link
Contributor

robhyrk commented Jun 4, 2024

Issue seems to be caused by incorrect price shown. The curent formula for calculating unrealized PnL is: currentMarketPrice - avgCost) * totalQuantity

@robhyrk robhyrk closed this as completed Jun 4, 2024
@Robiquet Robiquet reopened this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants