setIncentiveSettings would be halt during a rebalance operation that gets stuck due to supply cap is reached at Aave
setIncentiveSettings would be halt during a rebalance operation that gets stuck due to supply cap is reached at Aave\\nrebalance implement a cap of tradeSize and if the need to rebalance require taking more assets than the maxTradeSize, then `twapLeverageRatio` would be set to the targeted leverage. `twapLeverageRatio` == 0 is required during rebalance.\\nConsider:\\nlever is needed during rebalance, the strategy require to borrow more ETH and sell to wstETH during the 1st call of rebalance the protocol cache the new `twapLeverageRatio` However wstETH market in Aave reach supply cap. rebalance/iterateRebalance comes to a halt. `twapLeverageRatio` remains caching the targeted leverage\\nsetIncentiveSettings requires a condition in which no rebalance is in progress. With the above case, setIncentiveSettings can be halted for an extended period of time until the wstETH market falls under supply cap.\\nWorth-noting, at the time of writing this issue, the wstETH market at Aave has been at supply cap\\nIn this case, malicious actor who already has a position in wstETH can do the following:\\ndeposit into the setToken, trigger a rebalance.\\nmalicious trader withdraw his/her position in Aave wstETH market so there opens up vacancy for supply again.\\nprotocol owner see supply vacancy, call rebalance in order to lever as required. Now twapLeverageRatio is set to new value since multiple trades are needed\\nmalicious trader now re-supply the wstETH market at Aave so it reaches supply cap again.\\nthe protocol gets stuck with a non-zero twapLeverageRatio, `setIncentiveSettings` can not be called.\\n```\\n    function setIncentiveSettings(IncentiveSettings memory _newIncentiveSettings) external onlyOperator noRebalanceInProgress {\\n        incentive = _newIncentiveSettings;\\n\\n        _validateNonExchangeSettings(methodology, execution, incentive);\\n\\n        emit IncentiveSettingsUpdated(\\n            incentive.etherReward,\\n            incentive.incentivizedLeverageRatio,\\n            incentive.incentivizedSlippageTolerance,\\n            incentive.incentivizedTwapCooldownPeriod\\n        );\\n    }\\n```\\n
Add some checks on whether the supply cap of an Aave market is reached during a rebalance. If so, allows a re-set of twapLeverageRatio
setIncentiveSettings would be halt.
```\\n    function setIncentiveSettings(IncentiveSettings memory _newIncentiveSettings) external onlyOperator noRebalanceInProgress {\\n        incentive = _newIncentiveSettings;\\n\\n        _validateNonExchangeSettings(methodology, execution, incentive);\\n\\n        emit IncentiveSettingsUpdated(\\n            incentive.etherReward,\\n            incentive.incentivizedLeverageRatio,\\n            incentive.incentivizedSlippageTolerance,\\n            incentive.incentivizedTwapCooldownPeriod\\n        );\\n    }\\n```\\n