{
    "Function": "_updateTWAV",
    "File": "contracts/Twav/Twav.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _updateTWAV(uint256 _valuation, uint32 _blockTimestamp) internal {\n        uint32 _timeElapsed; \n        unchecked {\n            _timeElapsed = _blockTimestamp - lastBlockTimeStamp;\n        }\n\n        uint256 _prevCumulativeValuation = twavObservations[((twavObservationsIndex + TWAV_BLOCK_NUMBERS) - 1) % TWAV_BLOCK_NUMBERS].cumulativeValuation;\n        twavObservations[twavObservationsIndex] = TwavObservation(_blockTimestamp, _prevCumulativeValuation + (_valuation * _timeElapsed)); //add the previous observation to make it cumulative\n        twavObservationsIndex = (twavObservationsIndex + 1) % TWAV_BLOCK_NUMBERS;\n        lastBlockTimeStamp = _blockTimestamp;\n    }"
}