Skip to content

Commit

Permalink
TRCL-3370 Depth chart highlight, total cost was always $0 (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnqh authored Jan 10, 2024
1 parent 7133f9b commit 8f1c70b
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,7 @@ class dydxMarketDepthChartViewPresenter: HostedViewPresenter<dydxMarketDepthChar
let stepSize = market.configs?.displayStepSizeDecimals?.intValue ?? 1
self?.viewModel?.hightlight?.price = dydxFormatter.shared.dollar(number: NSNumber(value: order.price), digits: tickSize)
self?.viewModel?.hightlight?.size = dydxFormatter.shared.localFormatted(number: NSNumber(value: order.size), digits: stepSize)
if let depth = order.depth?.doubleValue {
self?.viewModel?.hightlight?.cost = dydxFormatter.shared.dollar(number: NSNumber(value: depth), digits: tickSize)
}
self?.viewModel?.hightlight?.cost = dydxFormatter.shared.dollar(number: NSNumber(value: order.depthCost), digits: 2) // This is total cost, always round to cents
self?.viewModel?.hightlight?.impact = dydxFormatter.shared.percent(number: self?.priceImpact(orderDataPoint: orderDataPoint), digits: 2)

switch orderDataPoint.side {
Expand Down

0 comments on commit 8f1c70b

Please sign in to comment.