@@ -488,25 +488,29 @@ contract StvStETHPool is StvPool {
488488 IVaultHub.VaultConnection memory connection = DASHBOARD.vaultConnection ();
489489
490490 uint256 maxReserveRatioBP = TOTAL_BASIS_POINTS - 1 ;
491+ uint256 maxForcedRebalanceThresholdBP = maxReserveRatioBP - 1 ;
491492
492493 /// Invariants from the OperatorGrid
493494 assert (connection.reserveRatioBP > 0 );
494495 assert (connection.reserveRatioBP <= maxReserveRatioBP);
495496 assert (connection.forcedRebalanceThresholdBP > 0 );
496- assert (connection.forcedRebalanceThresholdBP <= connection.reserveRatioBP);
497+ assert (connection.forcedRebalanceThresholdBP < connection.reserveRatioBP);
497498
498499 uint16 newReserveRatioBP = uint16 (Math.min (connection.reserveRatioBP + RESERVE_RATIO_GAP_BP, maxReserveRatioBP));
499- uint16 newThresholdBP =
500- uint16 (Math.min (connection.forcedRebalanceThresholdBP + RESERVE_RATIO_GAP_BP, maxReserveRatioBP));
500+ uint16 newForcedRebalanceThresholdBP = uint16 (
501+ Math.min (connection.forcedRebalanceThresholdBP + RESERVE_RATIO_GAP_BP, maxForcedRebalanceThresholdBP)
502+ );
501503
502504 StvStETHPoolStorage storage $ = _getStvStETHPoolStorage ();
503505
504- if (newReserveRatioBP == $.reserveRatioBP && newThresholdBP == $.forcedRebalanceThresholdBP) return ;
506+ if (newReserveRatioBP == $.reserveRatioBP && newForcedRebalanceThresholdBP == $.forcedRebalanceThresholdBP) {
507+ return ;
508+ }
505509
506510 $.reserveRatioBP = newReserveRatioBP;
507- $.forcedRebalanceThresholdBP = newThresholdBP ;
511+ $.forcedRebalanceThresholdBP = newForcedRebalanceThresholdBP ;
508512
509- emit VaultParametersUpdated (newReserveRatioBP, newThresholdBP );
513+ emit VaultParametersUpdated (newReserveRatioBP, newForcedRebalanceThresholdBP );
510514 }
511515
512516 // =================================================================================
0 commit comments