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 position total value display #6185

Conversation

greg-schrammel
Copy link
Contributor

@greg-schrammel greg-schrammel commented Oct 9, 2024

Fixes APP-####

What changed (plus any additional context for devs)

some positions are omitted from the total wallet balance, but should still display the position value in the position card

Screen recordings / screenshots

before/after

Screenshot 2024-10-09 at 20 14 44 Screenshot 2024-10-09 at 20 14 48

What to test

Copy link

linear bot commented Oct 9, 2024

@brunobar79
Copy link
Member

Launch in simulator or device for 1b40042

* omittedTotal is the total WITHOUT the positions that are omitted
* used for the total wallet balance, the position card still shows the normal total
*/
omittedTotal: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

found this name (ommitedTotal) kinda confusing but couldn't think of anything better, lmk if you think of a more descriptive name

Copy link
Member

Choose a reason for hiding this comment

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

idk maybe totalWithOmissions?

also ommited is spelled omitted btw

Copy link
Member

Choose a reason for hiding this comment

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

i think it would be a lot more clear if we first came up for a name for the types of positions that are being excluded. i'm still unclear on this. what dequalifies a position from having it's value being included in the total wallet balance?

totalBorrows = add(totalBorrows, nativeDisplay.amount);

if (borrow.omit_from_total) {
totalOmittedFromTotals = subtract(totalOmittedFromTotals, nativeDisplay.amount);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this make sense? we add the others but subtract the borrows

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean it works right, not sure if I missed some edge case

@derHowie
Copy link
Member

@greg-schrammel, code looks good but I'm unsure what to test. Is the moxie case the only thing I should test or are there other considerations?

@greg-schrammel
Copy link
Contributor Author

@greg-schrammel, code looks good but I'm unsure what to test. Is the moxie case the only thing I should test or are there other considerations?

yeah the only positions I know that can have the omit_from_total flag rn are moxie

@brunobar79 brunobar79 added release for release blockers and release candidate branches nice for release and removed release for release blockers and release candidate branches labels Oct 11, 2024
* omittedTotal is the total WITHOUT the positions that are omitted
* used for the total wallet balance, the position card still shows the normal total
*/
omittedTotal: {
Copy link
Member

Choose a reason for hiding this comment

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

idk maybe totalWithOmissions?

also ommited is spelled omitted btw

* omittedTotal is the total WITHOUT the positions that are omitted
* used for the total wallet balance, the position card still shows the normal total
*/
omittedTotal: {
Copy link
Member

Choose a reason for hiding this comment

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

i think it would be a lot more clear if we first came up for a name for the types of positions that are being excluded. i'm still unclear on this. what dequalifies a position from having it's value being included in the total wallet balance?

@greg-schrammel greg-schrammel merged commit 646902f into develop Oct 22, 2024
7 of 8 checks passed
@greg-schrammel greg-schrammel deleted the gregs/app-1920-display-moxie-positions-usd-value-in-wallet-correctly branch October 22, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants