Strategy

Strategy

This is an abstract contract that implements key functionality for all strategies. For example, the AaveLeverageStrategy contract inherits from Strategy and AaveCore.

collateralToken

1
contract IERC20 collateralToken
Copied!

receiptToken

1
address receiptToken
Copied!

pool

1
address pool
Copied!

feeCollector

1
address feeCollector
Copied!

swapManager

1
contract ISwapManager swapManager
Copied!

oraclePeriod

1
uint256 oraclePeriod
Copied!

oracleRouterIdx

1
uint256 oracleRouterIdx
Copied!

swapSlippage

1
uint256 swapSlippage
Copied!

_keepers

1
struct EnumerableSet.AddressSet _keepers
Copied!

UpdatedFeeCollector

1
event UpdatedFeeCollector(address previousFeeCollector, address newFeeCollector)
Copied!

UpdatedSwapManager

1
event UpdatedSwapManager(address previousSwapManager, address newSwapManager)
Copied!

UpdatedSwapSlippage

1
event UpdatedSwapSlippage(uint256 oldSwapSlippage, uint256 newSwapSlippage)
Copied!

UpdatedOracleConfig

1
event UpdatedOracleConfig(uint256 oldPeriod, uint256 newPeriod, uint256 oldRouterIdx, uint256 newRouterIdx)
Copied!

addKeeper

1
function addKeeper(address _keeperAddress) external
Copied!
Add given address in keepers list.
Name
Type
Description
_keeperAddress
address
keeper address to add.

keepers

1
function keepers() external view returns (address[])
Copied!
Return list of keepers

migrate

1
function migrate(address _newStrategy) external virtual
Copied!
Migrate all asset and vault ownership,if any, to new strategy
_beforeMigration hook can be implemented in child strategy to do extra steps.
Name
Type
Description
_newStrategy
address
Address of new strategy

removeKeeper

1
function removeKeeper(address _keeperAddress) external
Copied!
Remove given address from keepers list.
Name
Type
Description
_keeperAddress
address
keeper address to remove.

updateFeeCollector

1
function updateFeeCollector(address _feeCollector) external
Copied!
Update fee collector
Name
Type
Description
_feeCollector
address
fee collector address

updateSwapManager

1
function updateSwapManager(address _swapManager) external
Copied!
Update swap manager address
Name
Type
Description
_swapManager
address
swap manager address

updateSwapSlippage

1
function updateSwapSlippage(uint256 _newSwapSlippage) external
Copied!

updateOracleConfig

1
function updateOracleConfig(uint256 _newPeriod, uint256 _newRouterIdx) external
Copied!

approveToken

1
function approveToken() external
Copied!
Approve all required tokens

setupOracles

1
function setupOracles() external
Copied!

withdraw

1
function withdraw(uint256 _amount) external
Copied!
Withdraw collateral token from lending pool.
Name
Type
Description
_amount
uint256
Amount of collateral token

rebalance

1
function rebalance() external virtual
Copied!
Rebalance profit, loss and investment of this strategy

sweepERC20

1
function sweepERC20(address _fromToken) external
Copied!
sweep given token to feeCollector of strategy
Name
Type
Description
_fromToken
address
token address to sweep

token

1
function token() external view returns (address)
Copied!
Returns address of token correspond to collateral token

totalValue

1
function totalValue() public view virtual returns (uint256 _value)
Copied!
Calculate total value of asset under management
Report total value in collateral token

totalValueCurrent

1
function totalValueCurrent() external virtual returns (uint256)
Copied!
Calculate total value of asset under management (in real-time)
Report total value in collateral token

isReservedToken

1
function isReservedToken(address _token) public view virtual returns (bool)
Copied!
Check whether given token is reserved or not. Reserved tokens are not allowed to sweep.
Last modified 18d ago