Chainlink price feed is `deprecated`, not sufficiently validated and can return `stale` prices.
The function `_createActionInfo()` uses Chainlink's deprecated latestAnswer function, this function also does not guarantee that the price returned by the Chainlink price feed is not stale and there is no additional checks to ensure that the return values are valid.\\nThe internal function `_createActionInfo()` uses calls `strategy.collateralPriceOracle.latestAnswer()` and `strategy.borrowPriceOracle.latestAnswer()` that uses Chainlink's deprecated latestAnswer() to get the latest price. However, there is no check for if the return value is a stale data.\\n```\\nfunction _createActionInfo() internal view returns(ActionInfo memory) {\\n        ActionInfo memory rebalanceInfo;\\n\\n        // Calculate prices from chainlink. Chainlink returns prices with 8 decimal places, but we need 36 - underlyingDecimals decimal places.\\n        // This is so that when the underlying amount is multiplied by the received price, the collateral valuation is normalized to 36 decimals.\\n        // To perform this adjustment, we multiply by 10^(36 - 8 - underlyingDecimals)\\n        int256 rawCollateralPrice = strategy.collateralPriceOracle.latestAnswer();\\n        rebalanceInfo.collateralPrice = rawCollateralPrice.toUint256().mul(10 ** strategy.collateralDecimalAdjustment);\\n        int256 rawBorrowPrice = strategy.borrowPriceOracle.latestAnswer();\\n        rebalanceInfo.borrowPrice = rawBorrowPrice.toUint256().mul(10 ** strategy.borrowDecimalAdjustment);\\n// More Code// rest of code.\\n}\\n   \\n```\\n
The `latestRoundData` function should be used instead of the deprecated `latestAnswer` function and add sufficient checks to ensure that the pricefeed is not stale.\\n```\\n(uint80 roundId, int256 assetChainlinkPriceInt, , uint256 updatedAt, uint80 answeredInRound) = IPrice(_chainlinkFeed).latestRoundData();\\n            require(answeredInRound >= roundId, "price is stale");\\n            require(updatedAt > 0, "round is incomplete");\\n```\\n
The function `_createActionInfo()` is used to return important values used throughout the contract, the staleness of the chainlinklink return values will lead to wrong calculation of the collateral and borrow prices and other unexpected behavior.
```\\nfunction _createActionInfo() internal view returns(ActionInfo memory) {\\n        ActionInfo memory rebalanceInfo;\\n\\n        // Calculate prices from chainlink. Chainlink returns prices with 8 decimal places, but we need 36 - underlyingDecimals decimal places.\\n        // This is so that when the underlying amount is multiplied by the received price, the collateral valuation is normalized to 36 decimals.\\n        // To perform this adjustment, we multiply by 10^(36 - 8 - underlyingDecimals)\\n        int256 rawCollateralPrice = strategy.collateralPriceOracle.latestAnswer();\\n        rebalanceInfo.collateralPrice = rawCollateralPrice.toUint256().mul(10 ** strategy.collateralDecimalAdjustment);\\n        int256 rawBorrowPrice = strategy.borrowPriceOracle.latestAnswer();\\n        rebalanceInfo.borrowPrice = rawBorrowPrice.toUint256().mul(10 ** strategy.borrowDecimalAdjustment);\\n// More Code// rest of code.\\n}\\n   \\n```\\n