Skip to content

Commit

Permalink
remove keeper view function
Browse files Browse the repository at this point in the history
  • Loading branch information
pblivin0x committed Aug 28, 2024
1 parent c23238f commit 01216fe
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions contracts/adapters/TargetWeightWrapExtension.sol
Original file line number Diff line number Diff line change
Expand Up @@ -302,23 +302,6 @@ contract TargetWeightWrapExtension is BaseExtension, ReentrancyGuard {
reserveWeight = reserveValuation.preciseDiv(totalValuation);
}

/**
* @notice Gets the reserve weight delta relative to the min and max reserve weights.
* @return reserveWeightDeltaLow The delta between the reserve weight and nearest boundary weight.
* @return reserveWeightDeltaHigh The delta between the reserve weight and the farthest boundary weight.
*/
function getReserveWeightDelta() public view returns(uint256 reserveWeightDeltaLow, uint256 reserveWeightDeltaHigh) {
uint256 reserveWeight = getReserveWeight();
if (reserveWeight > rebalanceInfo.maxReserveWeight) {
reserveWeightDeltaLow = reserveWeight.sub(rebalanceInfo.maxReserveWeight);
reserveWeightDeltaHigh = reserveWeight.sub(rebalanceInfo.minReserveWeight);
}
if (reserveWeight < rebalanceInfo.minReserveWeight) {
reserveWeightDeltaLow = rebalanceInfo.minReserveWeight.sub(reserveWeight);
reserveWeightDeltaHigh = rebalanceInfo.maxReserveWeight.sub(reserveWeight);
}
}

/**
* @notice Checks if the reserve asset is overweight.
*/
Expand All @@ -333,24 +316,6 @@ contract TargetWeightWrapExtension is BaseExtension, ReentrancyGuard {
return getReserveWeight() < rebalanceInfo.minReserveWeight;
}

/**
* @notice Gets the target weight delta relative to the min and max target weights.
* @param _targetAsset The address of the target asset.
* @return targetWeightDeltaLow The delta between the target weight and nearest boundary weight.
* @return targetWeightDeltaHigh The delta between the target weight and the farthest boundary weight.
*/
function getTargetWeightDelta(address _targetAsset) public view returns (uint256 targetWeightDeltaLow, uint256 targetWeightDeltaHigh) {
uint256 targetWeight = getTargetAssetWeight(_targetAsset);
if (targetWeight > executionParams[_targetAsset].maxTargetWeight) {
targetWeightDeltaLow = targetWeight.sub(executionParams[_targetAsset].maxTargetWeight);
targetWeightDeltaHigh = targetWeight.sub(executionParams[_targetAsset].minTargetWeight);
}
if (targetWeight < executionParams[_targetAsset].minTargetWeight) {
targetWeightDeltaLow = executionParams[_targetAsset].minTargetWeight.sub(targetWeight);
targetWeightDeltaHigh = executionParams[_targetAsset].maxTargetWeight.sub(targetWeight);
}
}

/**
* @notice Checks if the target asset is overweight.
* @param _targetAsset The address of the target asset.
Expand Down

0 comments on commit 01216fe

Please sign in to comment.