File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ contract tBTCPriceFeed is CompositePriceFeed {
5454 if (_isRedemption && _withinDeviationThreshold (tbtcUsdPrice, btcUsdPrice, BTC_TBTC_DEVIATION_THRESHOLD)) {
5555 // If it's a redemption and within 2%, take the max of (tBTC-USD, BTC-USD) to prevent value leakage and convert to tBTC-USD
5656 tbtcUsdPrice = LiquityMath._max (tbtcUsdPrice, btcUsdPrice);
57+ }else {
58+ // Take the minimum of (market, canonical) in order to mitigate against upward market price manipulation.
59+ tbtcUsdPrice = LiquityMath._min (tbtcUsdPrice, btcUsdPrice);
5760 }
5861
5962 // Otherwise, just use tBTC-USD price: USD_per_tBTC.
@@ -62,7 +65,7 @@ contract tBTCPriceFeed is CompositePriceFeed {
6265 }
6366
6467 function _getCanonicalRate () internal view override returns (uint256 , bool ) {
65- return (1 , false ); // always return 1 BTC per tBTC by default.
68+ return (1 * 10 ** 18 , false ); // always return 1 BTC per tBTC by default.
6669 }
6770}
6871
You can’t perform that action at this time.
0 commit comments