Skip to main content

MorphoCompoundStrategy

MorphoCompoundStrategy

MORPHO

address MORPHO

LENS

address LENS

constructor

constructor(struct InitializableAbstractStrategy.BaseStrategyConfig _stratConfig) public

initialize

function initialize(address[] _rewardTokenAddresses, address[] _assets, address[] _pTokens) external

Initialize function, to set up initial internal state

Parameters

NameTypeDescription
_rewardTokenAddressesaddress[]Address of reward token for platform
_assetsaddress[]Addresses of initial supported assets
_pTokensaddress[]Platform Token corresponding addresses

safeApproveAllTokens

function safeApproveAllTokens() external

Approve the spending of all assets by main Morpho contract, if for some reason is it necessary.

_abstractSetPToken

function _abstractSetPToken(address _asset, address _pToken) internal

Internal method to respond to the addition of new asset We need to approve and allow Morpho to move them

Parameters

NameTypeDescription
_assetaddressAddress of the asset to approve
_pTokenaddressThe pToken for the approval

collectRewardTokens

function collectRewardTokens() external

Collect accumulated rewards and send them to Harvester.

getPendingRewards

function getPendingRewards() external view returns (uint256 balance)

Get the amount of rewards pending to be collected from the protocol

deposit

function deposit(address _asset, uint256 _amount) external

Deposit asset into Morpho

Parameters

NameTypeDescription
_assetaddressAddress of asset to deposit
_amountuint256Amount of asset to deposit

_deposit

function _deposit(address _asset, uint256 _amount) internal

Deposit asset into Morpho

Parameters

NameTypeDescription
_assetaddressAddress of asset to deposit
_amountuint256Amount of asset to deposit

depositAll

function depositAll() external

Deposit the entire balance of any supported asset into Morpho

withdraw

function withdraw(address _recipient, address _asset, uint256 _amount) external

Withdraw asset from Morpho

Parameters

NameTypeDescription
_recipientaddressAddress to receive withdrawn asset
_assetaddressAddress of asset to withdraw
_amountuint256Amount of asset to withdraw

_withdraw

function _withdraw(address _recipient, address _asset, uint256 _amount) internal

withdrawAll

function withdrawAll() external

Remove all assets from platform and send them to Vault contract.

checkBalance

function checkBalance(address _asset) external view returns (uint256 balance)

Return total value of an asset held in the platform

Parameters

NameTypeDescription
_assetaddressAddress of the asset

Return Values

NameTypeDescription
balanceuint256Total value of the asset in the platform

_checkBalance

function _checkBalance(address _asset) internal view returns (uint256 balance)