Skip to content

Commit

Permalink
adjust for breaking abacus changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dydx committed Jun 28, 2024
1 parent b7c6356 commit 5ed1476
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class dydxProfileRewardsViewPresenter: HostedViewPresenter<dydxProfileRew
// allTimeRewardsAmount is commented out because we do not have historical data accurate for "all time"
// see thread: https://dydx-team.slack.com/archives/C066T2L1HM4/p1703107669507409
// self?.viewModel?.allTimeRewardsAmount = dydxFormatter.shared.format(decimal: account?.tradingRewards?.total?.decimalValue)
if let amount = account?.tradingRewards?.historical?["WEEKLY"]?.first?.amount {
if let amount = account?.tradingRewards?.filledHistory?["WEEKLY"]?.first?.amount {
self?.viewModel?.last7DaysRewardsAmount = dydxFormatter.shared.raw(number: NSNumber(value: amount), digits: 4)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class dydxRewardsHistoryViewPresenter: HostedViewPresenter<dydxRewardsHis

AbacusStateManager.shared.setHistoricalTradingRewardPeriod(period: self.period.abacusPeriod)
AbacusStateManager.shared.state.account
.map(\.?.tradingRewards?.historical)
.map(\.?.tradingRewards?.filledHistory)
.sink { [weak self] historicalRewards in
self?.viewModel?.onSelectionChanged = {[weak self] index in
guard let self = self else { return }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class dydxRewardsSummaryViewPresenter: HostedViewPresenter<dydxRewardsSum
// allTimeRewardsAmount is commented out because we do not have historical data accurate for "all time"
// see thread: https://dydx-team.slack.com/archives/C066T2L1HM4/p1703107669507409
// self?.viewModel?.allTimeRewardsAmount = dydxFormatter.shared.format(decimal: account?.tradingRewards?.total?.decimalValue)
if let thisWeekRewards = account?.tradingRewards?.historical?["WEEKLY"]?.first {
if let thisWeekRewards = account?.tradingRewards?.filledHistory?["WEEKLY"]?.first {
self?.viewModel?.last7DaysRewardsAmount = dydxFormatter.shared.raw(number: NSNumber(value: thisWeekRewards.amount), digits: 4)
let startedAt = dydxFormatter.shared.millisecondsToDate(thisWeekRewards.startedAtInMilliseconds, format: .MMM_d)
let endedAt = dydxFormatter.shared.millisecondsToDate(thisWeekRewards.endedAtInMilliseconds, format: .MMM_d)
Expand Down

0 comments on commit 5ed1476

Please sign in to comment.