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

MOB-601 : Position Card Updates #206

Merged
merged 6 commits into from
Jul 2, 2024

Conversation

mike-dydx
Copy link
Contributor

@mike-dydx mike-dydx commented Jul 2, 2024

Links (dYdX Internal Use Only)

Linear Ticket: MOB-601 : Position Card Updates
Figma Design: https://www.figma.com/design/mKevZOfE9nj6MZpiolKYW1/dYdX-%E2%80%BA-Mobile?node-id=8654-3911&t=JinIZ2gSpoIFSaNj-4


Description / Intuition

  • adds notional value to position card
  • cleans up position card layout. Previously hard coding some heights/widths

Before/After Screenshots or Videos

Before After

Screenshot 2024-07-02 at 1 17 21 PM


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)
  • Refactoring or Technical Debt
  • Documentation update
  • Other (please describe: )

Copy link

linear bot commented Jul 2, 2024

Comment on lines +46 to +55
let tradeSummary = input.summary
let marketId = input.marketId
let market = marketMap[marketId ?? ""]
let position = positions.first(where: { $0.id == marketId })
self?.updateExpectedPrice(tradeSummary: tradeSummary, market: market)
self?.updateLiquidationPrice(position: position, market: market)
self?.updatePositionMargin(position: position)
self?.updatePositionLeverage(position: position)
self?.updateTradingFee(tradeSummary: tradeSummary)
self?.updateTradingRewards(tradeSummary: tradeSummary)
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 change ensures the initial (empty) state loads

despite null values, we still want to display the receipt line titles

@@ -119,7 +119,9 @@ class dydxPortfolioPositionsViewPresenter: HostedViewPresenter<dydxPortfolioPosi
let item = positionsCache?[position.assetId] ?? dydxPortfolioPositionItemViewModel()

let positionSize = abs(position.size.current?.doubleValue ?? 0)
let notionalValue = abs(position.valueTotal.current?.doubleValue ?? 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm i'm using notionalTotal here, what is valueTotal?

Copy link
Contributor

Choose a reason for hiding this comment

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

val valueTotal = size * oraclePrice
set(valueTotal, modified, "valueTotal", period)
val notional = valueTotal.abs()
set(notional, modified, "notionalTotal", period)

i think we want notionalTotal here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mmm good catch, i was looking for notionalTotal earlier but it wasn't autopopulating addressed in ba3fd6c

@mike-dydx mike-dydx merged commit edb05e9 into develop Jul 2, 2024
1 of 2 checks passed
@mike-dydx mike-dydx deleted the mike/mob-601-position-card-updates branch July 2, 2024 18:08
mike-dydx added a commit that referenced this pull request Aug 20, 2024
* add notional value to position card

* remove null checks to display empty state

* cache displayed alerts to not display again

* display liq/oracle price

* Revert "cache displayed alerts to not display again"

This reverts commit 3500ff0.

* use notional instead of value total
mike-dydx added a commit that referenced this pull request Aug 21, 2024
* add notional value to position card

* remove null checks to display empty state

* cache displayed alerts to not display again

* display liq/oracle price

* Revert "cache displayed alerts to not display again"

This reverts commit 3500ff0.

* use notional instead of value total
mike-dydx added a commit that referenced this pull request Aug 21, 2024
* add notional value to position card

* remove null checks to display empty state

* cache displayed alerts to not display again

* display liq/oracle price

* Revert "cache displayed alerts to not display again"

This reverts commit 3500ff0.

* use notional instead of value total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants