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

Realized pnl percent #935

Merged
merged 9 commits into from
Jun 9, 2022
Merged

Realized pnl percent #935

merged 9 commits into from
Jun 9, 2022

Conversation

Tburm
Copy link
Contributor

@Tburm Tburm commented Jun 2, 2022

Add a realized pnl percentage where relevant

Description

Adds realized pnl percentage:

  • On position card
  • On leaderboard trade history

Related issue

  • Kwenta/kwenta-private#489

Motivation and Context

We show a percentage for unrealized pnl, but not for realized pnl

How Has This Been Tested?

Placed trades on testnet and checked the values returned (total deposits, net transfers, realized pnl % for positions)

Screenshots (if appropriate):

Position Card:
image

Leaderboard:
image

@vercel
Copy link

vercel bot commented Jun 2, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
kwenta ✅ Ready (Inspect) Visit Preview Jun 9, 2022 at 7:44PM (UTC)

@Tburm Tburm requested a review from platschi June 2, 2022 21:13
@vercel vercel bot temporarily deployed to Preview June 2, 2022 21:18 Inactive
@vercel vercel bot temporarily deployed to Preview June 6, 2022 19:40 Inactive
@vercel vercel bot temporarily deployed to Preview June 7, 2022 20:04 Inactive
@vercel vercel bot temporarily deployed to Preview June 7, 2022 21:58 Inactive
@Tburm
Copy link
Contributor Author

Tburm commented Jun 8, 2022

One blocker to merging this is a subgraph issue:
image

@vercel vercel bot temporarily deployed to Preview June 8, 2022 18:43 Inactive
@Tburm Tburm marked this pull request as ready for review June 8, 2022 20:16
@Tburm
Copy link
Contributor Author

Tburm commented Jun 8, 2022

Solved the above on the frontend by capping losses at initial margin + deposit but we should update the subgraph value positionEntity.pnlWithFeesPaid to handle this, then implement it here (Issue)

@vercel vercel bot temporarily deployed to Preview June 9, 2022 19:44 Inactive
@platschi platschi merged commit c17f048 into v2-dev Jun 9, 2022
@platschi platschi deleted the realized-pnl-pct branch June 9, 2022 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants