```\n    function getTargetExternalLendingAmount(\n        Token memory underlyingToken,\n        PrimeCashFactors memory factors,\n        RebalancingTargetData memory rebalancingTargetData,\n        OracleData memory oracleData,\n        PrimeRate memory pr\n    ) internal pure returns (uint256 targetAmount) {\n// rest of code\n\n        targetAmount = SafeUint256.min(\n            // totalPrimeCashInUnderlying and totalPrimeDebtInUnderlying are in 8 decimals, convert it to native\n            // token precision here for accurate comparison. No underflow possible since targetExternalUnderlyingLend\n            // is floored at zero.\n            uint256(underlyingToken.convertToExternal(targetExternalUnderlyingLend)),\n            // maxExternalUnderlyingLend is limit enforced by setting externalWithdrawThreshold\n            // maxExternalDeposit is limit due to the supply cap on external pools\n          SafeUint256.min(maxExternalUnderlyingLend, oracleData.maxExternalDeposit)\n        );\n```\n