Skip to content

Commit eb442f2

Browse files
committed
Applied fix from mainnet subgraph.
1 parent 20bbce7 commit eb442f2

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

src/utilities/stakerutilities.ts

+1-28
Original file line numberDiff line numberDiff line change
@@ -240,33 +240,6 @@ class StakerUtilities {
240240
ethRewardsSincePreviousCheckpoint = activeETHBalance
241241
.minus(ethReceivedSinceThePreviousCheckpointAtPreviousExchangeRate)
242242
.minus(previousETHBalance)
243-
244-
/*
245-
Depending on the exchange rate differences for the previous and current checkpoint..
246-
- We might have lost value on the newly minted rETH amount. (if previous exchange rate > the current exchange rate)
247-
- We might have gained value on the newly minted rETH amount. (if previous exchange rate > the current exchange rate)
248-
We need to take this increase/decrease into account.
249-
*/
250-
let ethReceivedSinceThePreviousCheckpointAtCurrentExchangeRate = activeRETHBalance
251-
.minus(previousRETHBalance)
252-
.times(currentCheckpointExchangeRate)
253-
.div(ONE_ETHER_IN_WEI)
254-
if (
255-
ethReceivedSinceThePreviousCheckpointAtCurrentExchangeRate >
256-
ethReceivedSinceThePreviousCheckpointAtPreviousExchangeRate
257-
) {
258-
ethRewardsSincePreviousCheckpoint = ethRewardsSincePreviousCheckpoint.plus(
259-
ethReceivedSinceThePreviousCheckpointAtCurrentExchangeRate.minus(
260-
ethReceivedSinceThePreviousCheckpointAtPreviousExchangeRate,
261-
),
262-
)
263-
} else {
264-
ethRewardsSincePreviousCheckpoint = ethRewardsSincePreviousCheckpoint.minus(
265-
ethReceivedSinceThePreviousCheckpointAtPreviousExchangeRate.minus(
266-
ethReceivedSinceThePreviousCheckpointAtCurrentExchangeRate,
267-
),
268-
)
269-
}
270243
}
271244
}
272245

@@ -379,4 +352,4 @@ class StakerUtilities {
379352
}
380353
}
381354

382-
export let stakerUtilities = new StakerUtilities()
355+
export let stakerUtilities = new StakerUtilities()

0 commit comments

Comments
 (0)