Skip to content

Commit

Permalink
use notional instead of value total
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dydx committed Jul 2, 2024
1 parent cdf0254 commit ba3fd6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class dydxMarketPositionViewPresenter: HostedViewPresenter<dydxMarketPositionVie
viewModel?.logoUrl = sharedOrderViewModel.logoUrl
viewModel?.gradientType = sharedOrderViewModel.gradientType

viewModel?.amount = dydxFormatter.shared.dollar(number: position.valueTotal.current?.doubleValue, digits: 2)
viewModel?.amount = dydxFormatter.shared.dollar(number: position.notionalTotal.current?.doubleValue, digits: 2)

viewModel?.openPrice = dydxFormatter.shared.dollar(number: position.entryPrice.current?.doubleValue, digits: configs.displayTickSizeDecimals?.intValue ?? 0)
viewModel?.closePrice = dydxFormatter.shared.dollar(number: position.exitPrice?.doubleValue, digits: configs.displayTickSizeDecimals?.intValue ?? 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ 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)
let notionalValue = abs(position.notionalTotal.current?.doubleValue ?? 0)
item.size = dydxFormatter.shared.localFormatted(number: positionSize, digits: configs.displayStepSizeDecimals?.intValue ?? 1)
item.notionalValue = dydxFormatter.shared.dollar(number: notionalValue, digits: 2) ?? "--"
item.token?.symbol = asset.id
Expand Down

0 comments on commit ba3fd6c

Please sign in to comment.