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

Fix unstable/inflated unrealised pnl issues #347

Closed
wants to merge 60 commits into from

Conversation

EstherSeyi
Copy link
Contributor

@EstherSeyi EstherSeyi commented Apr 13, 2022

Task:

Description

  • Replaces vault manager subscription with polling to ensure that vault data is always updated.
  • Replaces swaps data with swaps atom in computeSwaps provider to ensure that squeethAmount is always updated for pnl calculation.
  • Removes swaps query subscription as it didn't seem to work and was causing bug of swaps being empty array sometimes.
  • Adds unit tests for unrealized pnl calculations. Run test with: yarn test pnl

Fixes # (issue)
#350

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Document update

How Has This Been Tested

You can test by seeing if you experience loading issues or incorrect pnl. see this doc for the unrealized pnl formulas.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Added video recordings if it is a UI change

@vercel
Copy link

vercel bot commented Apr 13, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/opynfinance/continuouscall/CaqYwbassRq9mAi9uPVQhivDN6eY
✅ Preview: https://continuouscall-git-fe-unrealized-pnl-issues-opynfinance.vercel.app

@KMKoushik
Copy link
Contributor

@EstherSeyi How do I test these and are there any issues created for this?

@EstherSeyi
Copy link
Contributor Author

EstherSeyi commented Apr 14, 2022

@EstherSeyi How do I test these and are there any issues created for this?

Yes I just created an issue. I think you can just watch and calculate the pnl to see that it's correct. Doc with formulas

@vercel
Copy link

vercel bot commented Apr 17, 2022

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

Name Status Preview Updated
continuouscall ✅ Ready (Inspect) Visit Preview May 4, 2022 at 0:28AM (UTC)

@EstherSeyi EstherSeyi linked an issue Apr 20, 2022 that may be closed by this pull request
Copy link
Contributor

@KMKoushik KMKoushik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My tx history is gone

preview:
Screen Shot 2022-04-27 at 9 18 59 am

Prod
Screen Shot 2022-04-27 at 9 19 38 am

Similarly my long position is also not shown

@EstherSeyi
Copy link
Contributor Author

continuouscall-git-fe-unrealized-pnl-issues-opynfinance.vercel.app

My tx history is gone

Similarly my long position is also not shown

@KMKoushik was there any error on your console

@KMKoushik
Copy link
Contributor

continuouscall-git-fe-unrealized-pnl-issues-opynfinance.vercel.app

My tx history is gone

Similarly my long position is also not shown

@KMKoushik was there any error on your console

Nothing new @EstherSeyi
Screen Shot 2022-04-27 at 8 58 40 pm

@EstherSeyi EstherSeyi force-pushed the fe/unrealized-pnl-issues branch from 4ade0cc to 53ee369 Compare May 2, 2022 11:46
@KMKoushik
Copy link
Contributor

@EstherSeyi Still getting the same issue. Seems to be working in ropsten but not in mainnet. I pinged you with the wallet address

@KMKoushik
Copy link
Contributor

Need to be merged after we fix positions completely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unrealized pnl issues Short position card pnl keeps showing loading state
4 participants