Skip to content

Commit

Permalink
refactor: increase precision of reserve and collateral factors (#3586)
Browse files Browse the repository at this point in the history
  • Loading branch information
therealemjy committed Dec 6, 2024
1 parent ddaccf9 commit 8e05c35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nervous-donkeys-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@venusprotocol/evm": patch
---

use 6 decimal points in returned value of convertFactorFromSmartContract utility function
2 changes: 1 addition & 1 deletion apps/evm/src/utilities/convertFactorFromSmartContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import BigNumber from 'bignumber.js';
import { COMPOUND_MANTISSA } from 'constants/compoundMantissa';

const convertFactorFromSmartContract = ({ factor }: { factor: BigNumber }) =>
new BigNumber(factor).dividedBy(COMPOUND_MANTISSA).dp(2).toNumber();
new BigNumber(factor).dividedBy(COMPOUND_MANTISSA).dp(6).toNumber();

export default convertFactorFromSmartContract;

0 comments on commit 8e05c35

Please sign in to comment.