If collateral factor is high enough, flutter ends up being out of bounds
In `USSDRebalancer` contract, function `SellUSSDBuyCollateral` will revert everytime a rebalance calls it, provided the collateral factor is greater than all the elements of the `flutterRatios` array.\\nFunction `SellUSSDBuyCollateral` calculates `flutter` as the lowest index of the `flutterRatios` array for which the collateral factor is smaller than the `flutter` ratio.\\n```\\nuint256 cf = IUSSD(USSD).collateralFactor();\\nuint256 flutter = 0;\\nfor (flutter = 0; flutter < flutterRatios.length; flutter++) {\\n if (cf < flutterRatios[flutter]) {\\n   break;\\n }\\n}\\n```\\n\\nThe problem arises when, if collateral factor is greater than all flutter values, after the loop `flutter = flutterRatios.length`.\\nThis `flutter` value is used afterwards here:\\n```\\n// rest of code\\nif (collateralval * 1e18 / ownval < collateral[i].ratios[flutter]) {\\n  portions++;\\n}\\n// rest of code\\n```\\n\\nAnd here:\\n```\\n// rest of code\\nif (collateralval * 1e18 / ownval < collateral[i].ratios[flutter]) {\\n if (collateral[i].token != uniPool.token0() || collateral[i].token != uniPool.token1()) {\\n   // don't touch DAI if it's needed to be bought (it's already bought)\\n   IUSSD(USSD).UniV3SwapInput(collateral[i].pathbuy, daibought/portions);\\n }\\n}\\n// rest of code\\n```\\n\\nAs we can see in the tests of the project, the flutterRatios array and the collateral `ratios` array are set to be of the same length, so if flutter = flutterRatios.length, any call to that index in the `ratios` array will revert with an index out of bounds.
When checking `collateral[i].ratios[flutter]` always check first that flutter is `< flutterRatios.length`.
High, when the collateral factor reaches certain level, a rebalance that calls `SellUSSDBuyCollateral` will always revert.
```\\nuint256 cf = IUSSD(USSD).collateralFactor();\\nuint256 flutter = 0;\\nfor (flutter = 0; flutter < flutterRatios.length; flutter++) {\\n if (cf < flutterRatios[flutter]) {\\n   break;\\n }\\n}\\n```\\n