Overcomplicated unit conversions
There are many instances of unit conversion in the system that are implemented in a confusing way. This could result in mistakes in the conversion and possibly failure in correct accounting. It's been seen in the ecosystem that these type of complicated unit conversions could result in calculation mistake and loss of funds.\\nHere are a few examples:\\n```\\n    function getBorrowRatePerBlock(address \\_token) public view returns(uint) {\\n        if(!globalConfig.tokenInfoRegistry().isSupportedOnCompound(\\_token))\\n        // If the token is NOT supported by the third party, borrowing rate = 3% + U \\* 15%.\\n            return getCapitalUtilizationRatio(\\_token).mul(globalConfig.rateCurveSlope()).div(INT\\_UNIT).add(globalConfig.rateCurveConstant()).div(BLOCKS\\_PER\\_YEAR);\\n\\n        // if the token is suppored in third party, borrowing rate = Compound Supply Rate \\* 0.4 + Compound Borrow Rate \\* 0.6\\n        return (compoundPool[\\_token].depositRatePerBlock).mul(globalConfig.compoundSupplyRateWeights()).\\n            add((compoundPool[\\_token].borrowRatePerBlock).mul(globalConfig.compoundBorrowRateWeights())).div(10);\\n    }\\n```\\n\\n```\\n                compoundPool[\\_token].depositRatePerBlock = cTokenExchangeRate.mul(UNIT).div(lastCTokenExchangeRate[cToken])\\n                    .sub(UNIT).div(blockNumber.sub(lastCheckpoint[\\_token]));\\n```\\n\\n```\\n        return lastDepositeRateIndex.mul(getBlockNumber().sub(lcp).mul(depositRatePerBlock).add(INT\\_UNIT)).div(INT\\_UNIT);\\n```\\n
Simplify the unit conversions in the system. This can be done either by using a function wrapper for units to convert all values to the same unit before including them in any calculation or by better documenting every line of unit conversion
```\\n    function getBorrowRatePerBlock(address \\_token) public view returns(uint) {\\n        if(!globalConfig.tokenInfoRegistry().isSupportedOnCompound(\\_token))\\n        // If the token is NOT supported by the third party, borrowing rate = 3% + U \\* 15%.\\n            return getCapitalUtilizationRatio(\\_token).mul(globalConfig.rateCurveSlope()).div(INT\\_UNIT).add(globalConfig.rateCurveConstant()).div(BLOCKS\\_PER\\_YEAR);\\n\\n        // if the token is suppored in third party, borrowing rate = Compound Supply Rate \\* 0.4 + Compound Borrow Rate \\* 0.6\\n        return (compoundPool[\\_token].depositRatePerBlock).mul(globalConfig.compoundSupplyRateWeights()).\\n            add((compoundPool[\\_token].borrowRatePerBlock).mul(globalConfig.compoundBorrowRateWeights())).div(10);\\n    }\\n```\\n