Skip to content

Commit

Permalink
build: add delta
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Oct 15, 2024
1 parent 0e94ed8 commit 8047191
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/AprOracle/AprOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,16 @@ contract AprOracle is Governance {
if (debt == 0) continue;

// Get a performance fee if the strategy has one.
(, bytes memory fee) = strategies[i].staticcall(
(bool success, bytes memory fee) = strategies[i].staticcall(
abi.encodeWithSelector(
IStrategy(strategies[i]).performanceFee.selector
)
);
uint256 performanceFee = abi.decode(fee, (uint256));

uint256 performanceFee;
if (success) {
performanceFee = abi.decode(fee, (uint256));
}

// Get the effective debt change for the strategy.
int256 debtChange = (_delta * int256(debt)) / int256(totalAssets);
Expand All @@ -216,5 +220,4 @@ contract AprOracle is Governance {
// Divide by the total assets to get apr as 1e18.
return totalApr / uint256(int256(totalAssets) + _delta);
}

}

0 comments on commit 8047191

Please sign in to comment.