```\nFile: TreasuryAction.sol\n    function _rebalanceCurrency(uint16 currencyId, bool useCooldownCheck) private { \n        RebalancingContextStorage memory context = LibStorage.getRebalancingContext()[currencyId]; \n        // Accrues interest up to the current block before any rebalancing is executed\n        IPrimeCashHoldingsOracle oracle = PrimeCashExchangeRate.getPrimeCashHoldingsOracle(currencyId); \n        PrimeRate memory pr = PrimeRateLib.buildPrimeRateStateful(currencyId); \n\n        bool hasCooldownPassed = _hasCooldownPassed(context); \n        (bool isExternalLendingUnhealthy, OracleData memory oracleData, uint256 targetAmount) = \n            _isExternalLendingUnhealthy(currencyId, oracle, pr); \n\n        // Cooldown check is bypassed when the owner updates the rebalancing targets\n        if (useCooldownCheck) require(hasCooldownPassed || isExternalLendingUnhealthy); \n```\n