LibOracle fails to check the fidelity of price data from WETH/USDC pool, which can lead to price manipulation
As per the documentation, LibOracle should only be returning the TWAP price from the WETH/USDC pool if the amount of WETH in the pool is >= 100e18. This is to ensure the fidelity of the data, which reduces the risk of price manipulation. However, this is not properly implemented for the case in which there was an invalid fetch of chainlink data. In this case, LibOracle simply returns the TWAP price without checking if there's enough liquidity in the pool. This can lead to a lack of data fidelity for the returned price.\\nIt's clear that reverting should be the correct action rather than returning the TWAP price without checking the liquidity, as even when there is a valid chainlink price, if the TWAP price is closer to the cached price (and there isn't enough liquidity), it will still revert.\\nLibOracle has a `baseOracleCircuitBreaker` function which handles whether to return the TWAP price or the chainlink price, when the asset is USD, and it is defined as follows:\\n```\\nfunction baseOracleCircuitBreaker(\\n    uint256 protocolPrice,\\n    uint80 roundId,\\n    int256 chainlinkPrice,\\n    uint256 timeStamp,\\n    uint256 chainlinkPriceInEth\\n) private view returns (uint256 _protocolPrice) {\\n    bool invalidFetchData = roundId == 0 || timeStamp == 0\\n        || timeStamp > block.timestamp || chainlinkPrice <= 0\\n        || block.timestamp > 2 hours + timeStamp;\\n    // rest of code\\n    if (invalidFetchData || priceDeviation) {\\n        uint256 twapPrice = IDiamond(payable(address(this))).estimateWETHInUSDC(\\n            Constants.UNISWAP_WETH_BASE_AMT, 30 minutes\\n        );\\n        uint256 twapPriceInEther = (twapPrice / Constants.DECIMAL_USDC) * 1 ether;\\n        uint256 twapPriceInv = twapPriceInEther.inv();\\n        if (twapPriceInEther == 0) {\\n            revert Errors.InvalidTwapPrice();\\n        }\\n\\n        if (invalidFetchData) {\\n            return twapPriceInv; // @issue\\n        } else {\\n            // rest of code\\n        }\\n    } else {\\n        return chainlinkPriceInEth;\\n    }\\n}\\n```\\n\\nWhen `invalidFetchData` is true, meaning that the chainlink price was not properly fetched, it will always return `twapPriceInv`. However, this lacks any checks as to whether there is at least 100 WETH in the Uniswap pool, which can result in a lack of data fidelity.
LibOracle fails to check the fidelity of price data from WETH/USDC pool, which can lead to price manipulation\\nBefore returning the TWAP price when `invalidFetchData` is true, first check whether the WETH/USDC pool has enough liquidity.
When the chainlink oracle is not functioning correctly, LibOracle will always return the TWAP price for the USD asset. However, this lacks any check as to whether there is enough liquidity in the Uniswap pool to guarantee data fidelity, meaning there is a higher likelihood of price manipulation.
```\\nfunction baseOracleCircuitBreaker(\\n    uint256 protocolPrice,\\n    uint80 roundId,\\n    int256 chainlinkPrice,\\n    uint256 timeStamp,\\n    uint256 chainlinkPriceInEth\\n) private view returns (uint256 _protocolPrice) {\\n    bool invalidFetchData = roundId == 0 || timeStamp == 0\\n        || timeStamp > block.timestamp || chainlinkPrice <= 0\\n        || block.timestamp > 2 hours + timeStamp;\\n    // rest of code\\n    if (invalidFetchData || priceDeviation) {\\n        uint256 twapPrice = IDiamond(payable(address(this))).estimateWETHInUSDC(\\n            Constants.UNISWAP_WETH_BASE_AMT, 30 minutes\\n        );\\n        uint256 twapPriceInEther = (twapPrice / Constants.DECIMAL_USDC) * 1 ether;\\n        uint256 twapPriceInv = twapPriceInEther.inv();\\n        if (twapPriceInEther == 0) {\\n            revert Errors.InvalidTwapPrice();\\n        }\\n\\n        if (invalidFetchData) {\\n            return twapPriceInv; // @issue\\n        } else {\\n            // rest of code\\n        }\\n    } else {\\n        return chainlinkPriceInEth;\\n    }\\n}\\n```\\n