Users may not be able to fully redeem USD1 into USDT even when reserve ratio is above 100%
Users may not be able to fully redeem USDT even when reserve ratio is above 100%, because of portfolio being taken into the account for calculation.\\nReserve ratio shows how many liabilities is covered by reserves, a reserve ratio above 100% guarantees protocol has enough USDT to redeem, the way of calculating reserve ratio is `Reserve Ratio = allReserves / liabilities` and is implemented in Unitas#_getReserveStatus(...) function:\\n```\\n            reserveRatio = ScalingUtils.scaleByBases(\\n                allReserves * valueBase / liabilities,\\n                valueBase,\\n                tokenManager.RESERVE_RATIO_BASE()\\n            );\\n```\\n\\n`allReserves` is the sum of the balance of Unitas and InsurancePool, calculated in Unitas#_getTotalReservesAndCollaterals() function:\\n```\\n        for (uint256 i; i < tokenCount; i++) {\\n            address token = tokenManager.tokenByIndex(tokenTypeValue, i);\\n            uint256 tokenReserve = _getBalance(token);\\n            uint256 tokenCollateral = IInsurancePool(insurancePool).getCollateral(token);\\n\\n\\n            if (tokenReserve > 0 || tokenCollateral > 0) {\\n                uint256 price = oracle.getLatestPrice(token);\\n\\n\\n                reserves += _convert(\\n                    token,\\n                    baseToken,\\n                    tokenReserve,\\n                    MathUpgradeable.Rounding.Down,\\n                    price,\\n                    priceBase,\\n                    token\\n                );\\n\\n\\n                collaterals += _convert(\\n                    token,\\n                    baseToken,\\n                    tokenCollateral,\\n                    MathUpgradeable.Rounding.Down,\\n                    price,\\n                    priceBase,\\n                    token\\n                );\\n            }\\n        }\\n```\\n\\n`liabilities` is the total value of USD1 and USDEMC tokens, calculated in Unitas#_getTotalLiabilities() function:\\n```\\n        for (uint256 i; i < tokenCount; i++) {\\n            address token = tokenManager.tokenByIndex(tokenTypeValue, i);\\n            uint256 tokenSupply = IERC20Token(token).totalSupply();\\n\\n\\n            if (token == baseToken) {\\n                // Adds up directly when the token is USD1\\n                liabilities += tokenSupply;\\n            } else if (tokenSupply > 0) {\\n                uint256 price = oracle.getLatestPrice(token);\\n\\n\\n                liabilities += _convert(\\n                    token,\\n                    baseToken,\\n                    tokenSupply,\\n                    MathUpgradeable.Rounding.Down,\\n                    price,\\n                    priceBase,\\n                    token\\n                );\\n            }\\n        }\\n```\\n\\nSome amount of USDT in both Unitas and InsurancePool is `portfolio`, which represents the current amount of assets used for strategic investments, it is worth noting that after sending `portfolio`, `balance` remains the same, which means `portfolio` is taken into account in the calculation of reserve ratio.\\nThis is problematic because `portfolio` is not available when user redeems, and user may not be able to fully redeem for USDT even when protocols says there is sufficient reserve ratio.\\nLet's assume :\\nUnitas's balance is 10000 USD and its portfolio is 2000 USD, avaliable balance is 8000 USD InsurancePool's balance is 3000 USD and its portfolio is 600 USD, available balance is 2400 USD AllReserves value is 13000 USD Liabilities (USDEMC) value is 10000 USD Reserve Ratio is (10000 + 3000) / 10000 = 130%.\\nLater on, USDEMC appreciates upto 10% and we can get:\\nAllReserves value is still 13000 USD Liabilities (USDEMC) value is 11000 USD Reserve Ratio is (10000 + 3000) / 11000 = 118%.\\nThe available balance in Unitas is 8000 USD so there is 3000 USD in short, it needs to be obtain from InsurancePool, however, the available balance in InsurancePool is 2400 USD, transaction will be reverted and users cannot redeem.\\nThere would also be an extreme situation when reserve ratio is above 100% but there is no available `balance` in protocol because all the `balance` is `portfolio` (this is possible when InsurancePool is drained out), users cannot redeem any USDT in this case.
Portfolio should not be taken into account for the calculation of reserve ratio.\\n```\\n    function _getTotalReservesAndCollaterals() internal view returns (uint256 reserves, uint256 collaterals) {\\n        // rest of code\\n// Remove the line below\\n           uint256 tokenReserve = _getBalance(token);\\n// Add the line below\\n           uint256 tokenReserve = _getBalance(token) // Remove the line below\\n _getPortfolio(token);\\n// Remove the line below\\n           uint256 tokenCollateral = IInsurancePool(insurancePool).getCollateral(token);\\n// Add the line below\\n           uint256 tokenCollateral = IInsurancePool(insurancePool).getCollateral(token) // Remove the line below\\n IInsurancePool(insurancePool).getPortfolio(token);\\n        // rest of code\\n    }\\n```\\n
Users may not be able to fully redeem USD1 into USDT even when reserve ratio is above 100%, this defeats the purpose of reserve ratio and breaks the promise of the protocol, users may be mislead and lose funds.
```\\n            reserveRatio = ScalingUtils.scaleByBases(\\n                allReserves * valueBase / liabilities,\\n                valueBase,\\n                tokenManager.RESERVE_RATIO_BASE()\\n            );\\n```\\n