Skip to content

Commit

Permalink
Fix: participation rate accuracy (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickimoore committed Dec 17, 2024
1 parent ad63b52 commit 03be39a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions backend/src/beacon/beacon.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ export class BeaconService {
current_epoch_active_gwei,
} = data.data;

const rate = Math.round(
const rate =
(previous_epoch_target_attesting_gwei / current_epoch_active_gwei) *
100,
);
100;
const truncatedRate = Math.trunc(rate * 100) / 100;

const status = getStatus(rate);
const status = getStatus(truncatedRate);

return {
rate,
rate: truncatedRate,
status,
};
},
Expand Down

0 comments on commit 03be39a

Please sign in to comment.