Skip to content

Commit

Permalink
feat: computeRebalanceAmount public function
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtekgrinder committed Oct 8, 2024
1 parent 3eb3da7 commit 7b0d455
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions contracts/helpers/BaseHarvester.sol
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,20 @@ abstract contract BaseHarvester is IHarvester, AccessControl {
_setMaxSlippage(newMaxSlippage);
}

/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VIEW FUNCTIONS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/

/**
* @notice Compute the amount needed to rebalance the Transmuter
* @param yieldBearingAsset address of the yield bearing asset
* @return increase whether the exposure should be increased
* @return amount amount to be rebalanced
*/
function computeRebalanceAmount(address yieldBearingAsset) external view returns (uint8 increase, uint256 amount) {
return _computeRebalanceAmount(yieldBearingAsset, yieldBearingData[yieldBearingAsset]);
}

/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
INTERNAL FUNCTIONS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
Expand Down

0 comments on commit 7b0d455

Please sign in to comment.