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

contract IERC20 collateralToken

receiptToken

address receiptToken

pool

address pool

feeCollector

address feeCollector

swapManager

contract ISwapManager swapManager

oraclePeriod

uint256 oraclePeriod

oracleRouterIdx

uint256 oracleRouterIdx

swapSlippage

uint256 swapSlippage

_keepers

struct EnumerableSet.AddressSet _keepers

UpdatedFeeCollector

event UpdatedFeeCollector(address previousFeeCollector, address newFeeCollector)

UpdatedSwapManager

event UpdatedSwapManager(address previousSwapManager, address newSwapManager)

UpdatedSwapSlippage

event UpdatedSwapSlippage(uint256 oldSwapSlippage, uint256 newSwapSlippage)

UpdatedOracleConfig

event UpdatedOracleConfig(uint256 oldPeriod, uint256 newPeriod, uint256 oldRouterIdx, uint256 newRouterIdx)

addKeeper

function addKeeper(address _keeperAddress) external

Add given address in keepers list.

Name
Type
Description

_keeperAddress

address

keeper address to add.

keepers

function keepers() external view returns (address[])

Return list of keepers

migrate

function migrate(address _newStrategy) external virtual

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

function removeKeeper(address _keeperAddress) external

Remove given address from keepers list.

Name
Type
Description

_keeperAddress

address

keeper address to remove.

updateFeeCollector

function updateFeeCollector(address _feeCollector) external

Update fee collector

Name
Type
Description

_feeCollector

address

fee collector address

updateSwapManager

function updateSwapManager(address _swapManager) external

Update swap manager address

Name
Type
Description

_swapManager

address

swap manager address

updateSwapSlippage

function updateSwapSlippage(uint256 _newSwapSlippage) external

updateOracleConfig

function updateOracleConfig(uint256 _newPeriod, uint256 _newRouterIdx) external

approveToken

function approveToken() external

Approve all required tokens

setupOracles

function setupOracles() external

withdraw

function withdraw(uint256 _amount) external

Withdraw collateral token from lending pool.

Name
Type
Description

_amount

uint256

Amount of collateral token

rebalance

function rebalance() external virtual

Rebalance profit, loss and investment of this strategy

sweepERC20

function sweepERC20(address _fromToken) external

sweep given token to feeCollector of strategy

Name
Type
Description

_fromToken

address

token address to sweep

token

function token() external view returns (address)

Returns address of token correspond to collateral token

totalValue

function totalValue() public view virtual returns (uint256 _value)

Calculate total value of asset under management

Report total value in collateral token

totalValueCurrent

function totalValueCurrent() external virtual returns (uint256)

Calculate total value of asset under management (in real-time)

Report total value in collateral token

isReservedToken

function isReservedToken(address _token) public view virtual returns (bool)

Check whether given token is reserved or not. Reserved tokens are not allowed to sweep.

Last updated