-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
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) |
There was a problem hiding this comment.
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
This reverts commit 3500ff0.
@@ -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) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
* 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
* 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
* 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
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
Before/After Screenshots or Videos
Type of Change