     //@audit let's say price is out of date and its getting updated won't it get the price from one hour ago?
    //problem is it uses a current timestamp but with an hour old price
            if (block.timestamp - lastUpdate < updateWaitWindow) revert BalancerOracle__update_InUpdateWaitWindow();
            // update the safe price first
            safePrice = safePrice_ = currentPrice;
            lastUpdate = block.timestamp;

            uint256[] memory weights = IWeightedPool(pool).getNormalizedWeights();
            uint256 totalSupply = IWeightedPool(pool).totalSupply();

            uint256 totalPi = WAD;
            uint256[] memory prices = new uint256[](weights.length);
            // update balances in 18 decimals
            for (uint256 i = 0; i < weights.length; i++) {
                // reverts if the price is invalid or stale
                prices[i] = _getTokenPrice(i);
                uint256 val = wdiv(prices[i], weights[i]);
                uint256 indivPi = uint256(wpow(int256(val), int256(weights[i])));

                totalPi = wmul(totalPi, indivPi);
            }

            currentPrice = wdiv(wmul(totalPi, IWeightedPool(pool).getInvariant()), totalSupply);
