Skip to content

Commit a926f68

Browse files
rickimooreAgeManning
authored andcommitted
Fix: participation rate accuracy (#285)
1 parent ace9032 commit a926f68

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

backend/src/beacon/beacon.service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,15 @@ export class BeaconService {
167167
current_epoch_active_gwei,
168168
} = data.data;
169169

170-
const rate = Math.round(
170+
const rate =
171171
(previous_epoch_target_attesting_gwei / current_epoch_active_gwei) *
172-
100,
173-
);
172+
100;
173+
const truncatedRate = Math.trunc(rate * 100) / 100;
174174

175-
const status = getStatus(rate);
175+
const status = getStatus(truncatedRate);
176176

177177
return {
178-
rate,
178+
rate: truncatedRate,
179179
status,
180180
};
181181
},

0 commit comments

Comments
 (0)