generated from yearn/tokenized-strategy-foundry-mix
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7664ff9
commit 36b5629
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: AGPL-3.0 | ||
pragma solidity 0.8.18; | ||
|
||
import {AprOracleBase} from "@periphery/AprOracle/AprOracleBase.sol"; | ||
|
||
contract StrategyAprOracle is AprOracleBase { | ||
constructor() AprOracleBase("Strategy Apr Oracle Example", msg.sender) {} | ||
|
||
/** | ||
* @notice Will return the expected Apr of a strategy post a debt change. | ||
* @dev _delta is a signed integer so that it can also represent a debt | ||
* decrease. | ||
* | ||
* This should return the annual expected return at the current timestamp | ||
* represented as 1e18. | ||
* | ||
* ie. 10% == 1e17 | ||
* | ||
* _delta will be == 0 to get the current apr. | ||
* | ||
* This will potentially be called during non-view functions so gas | ||
* efficiency should be taken into account. | ||
* | ||
* @param _strategy The token to get the apr for. | ||
* @param _delta The difference in debt. | ||
* @return . The expected apr for the strategy represented as 1e18. | ||
*/ | ||
function aprAfterDebtChange( | ||
address _strategy, | ||
int256 _delta | ||
) external view override returns (uint256) { | ||
// TODO: Implement any necessary logic to return the most accurate | ||
// APR estimation for the strategy. | ||
return 1e17; | ||
} | ||
} |