From 14f3ef0136ebf970b8c3f964321e13ca8a1ceed2 Mon Sep 17 00:00:00 2001 From: Jacob Eliosoff Date: Mon, 18 Jan 2021 02:43:34 -0500 Subject: [PATCH] Extended our Uniswap TWAP period from 2 minutes to 10 minutes, for safety (harder to manipulate). --- contracts/oracles/OurUniswapV2TWAPOracle.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/oracles/OurUniswapV2TWAPOracle.sol b/contracts/oracles/OurUniswapV2TWAPOracle.sol index 6f220ba..97cc250 100755 --- a/contracts/oracles/OurUniswapV2TWAPOracle.sol +++ b/contracts/oracles/OurUniswapV2TWAPOracle.sol @@ -22,7 +22,7 @@ contract OurUniswapV2TWAPOracle is Oracle { * These roles could in principle be separated, eg: "Require the stored price we calculate TWAP from to be >= 2 minutes * old, but leave >= 10 minutes before storing a new price." But for simplicity we keep them the same. */ - uint public constant MIN_TWAP_PERIOD = 2 minutes; + uint public constant MIN_TWAP_PERIOD = 10 minutes; // Uniswap stores its cumulative prices in "FixedPoint.uq112x112" format - 112-bit fixed point: uint public constant UNISWAP_CUM_PRICE_SCALE_FACTOR = 2 ** 112;