Skip to content

Commit

Permalink
fixed formula
Browse files Browse the repository at this point in the history
  • Loading branch information
kexleyBeefy committed Jun 21, 2024
1 parent 83315e6 commit f780f8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/apr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function calculateLastApr(
for (let i = 0; i < APRs.length; i++) {
durationSum = durationSum.plus(durations[i].dividedBy(periodMs));
timeWeight = timeWeight.plus(durations[i].times(durationSum));
weighedAPRSum = weighedAPRSum.plus(APRs[i].times(timeWeight));
weighedAPRSum = weighedAPRSum.plus(APRs[i].times(durations[i]).times(durationSum));
}

const apr = weighedAPRSum.div(timeWeight);
Expand Down

0 comments on commit f780f8d

Please sign in to comment.