Skip to content

Commit

Permalink
Merge pull request #247 from mrgnlabs/j/fix-emissions-cal
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbpvsc authored Sep 27, 2023
2 parents 6495978 + 2407255 commit 59041aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/marginfi-client-v2/src/models/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class Balance {
const lastUpdate = this.lastUpdate;
const period = new BigNumber(currentTimestamp - lastUpdate);
const emissionsRate = new BigNumber(bank.emissionsRate);
const emissions = period.times(balanceAmount).times(emissionsRate).div(31_536_000_000_000);
const emissions = period.times(balanceAmount).times(emissionsRate).div(31_536_000 * Math.pow(10, bank.mintDecimals));
const emissionsReal = BigNumber.min(emissions, new BigNumber(bank.emissionsRemaining));

return emissionsReal;
Expand Down

0 comments on commit 59041aa

Please sign in to comment.