Skip to content

Commit

Permalink
Merge pull request #708 from open-dollar/fix-math
Browse files Browse the repository at this point in the history
Fix math
  • Loading branch information
daopunk authored Jun 5, 2024
2 parents 0f28885 + 7ecf592 commit 5ca9dfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/contracts/proxies/NFTRenderer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,16 @@ contract NFTRenderer is Authorizable {

IOracleRelayer.OracleRelayerCollateralParams memory oracleParams = _oracleRelayer.cParams(cType);
IDelayedOracle oracle = oracleParams.oracle;
uint256 safetyCRatio = oracleParams.safetyCRatio / 10e24;
uint256 liquidationCRatio = oracleParams.liquidationCRatio / 10e24;
uint256 safetyCRatio = oracleParams.safetyCRatio / 1e25;
uint256 liquidationCRatio = oracleParams.liquidationCRatio / 1e25;

uint256 ratio;
uint256 state;
if (collateral > 0) {
if (debt > 0) {
state = 2;
ISAFEEngine.SAFEEngineCollateralData memory cTypeData = _safeEngine.cData(cType);
ratio = ((collateral.wmul(oracle.read())).wdiv(debt.wmul(cTypeData.accumulatedRate))) / 1e7; // _RAY to _WAD conversion
ratio = ((collateral.wmul(oracle.read())).wdiv(debt.wmul(cTypeData.accumulatedRate))) / 1e7;
} else {
state = 1;
ratio = 200;
Expand Down

0 comments on commit 5ca9dfe

Please sign in to comment.