Skip to content

Bug: unrealized PnL only reflecting yield delta instead of total usd equity change #581

@Shreyas-bellary

Description

@Shreyas-bellary

Describe the bug
The USD PnL calculation is misleading because it ignores price fluctuations. It only calculates the USD value of the yield (the difference in token amount). We should maybe create multiple views of the PnL one based on usd equity and other on collateral yield.

To Reproduce
Steps to reproduce the behavior:

  1. open a LT position
  2. when the underlying asset price (eth) drops significantly
  3. check the PnL on the app dashboard
  4. the PnL doesn't reflect loss from price drop, it likely shows the value of yield earned during that period

Expected behavior
unrealized PnL in USD should be (current total equity) - (initial total equity).
If we only want to show the value of the yield, we should rename the label, otherwise, users think they are profitable when they are actually down.

Additional context
chad confirmed the current logic where we take the delta in tokens (Current Equity - Initial Equity) and convert that to usd.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions