Function: setWeightStrategy(uint8 weightId, uint16 proportion, uint256[] fixedWeights)
A restricted onlyOwner
function. There are not checks of fixedWeights
values if weightId
== 1 or 4. Also, fixedWeights
can be an empty list.
Inputs
weightId
Constraints:
0 < weightId <= 4
, but it should be0 < weightId < 4
.Impact: defines the strategy to use for weights. If
weightId == 3
,fixedWeights
containsmarketIds
and threshold. IfweightId == 2
, thenfixedWeights
contains the custom weights. IfweightId == 1
, thenequalWeight
, that is, all available funds will be equally distributed between the vaults.
proportion
Constraints:
proportion <= 9999
.Impact: Proportion of vault funds to use in each deployment to strategy.
fixedWeights
Constraints: If
weightId == 2
, then the sum of weights should not be more than 10,000.Impact: Update the global
vaultWeights
, which is used byPositionSizer._thresholdWeight
andPositionSizer._fixedWeight
.
Branches and code coverage (including function calls)
Intended branches
weightStrategy
,weightProportion
, andvaultWeights
are updated properly.
Negative behavior
weightId == 0
.proportion > 9_999
.weightId > strategyCount()
.weightId == 2
andfixedWeights.length != vaultList.length
.weightId == 3
andfixedWeights.length != vaultList.length + 1
.