MaxApyStrategy
MaxApyStrategy.sol
is a contract that defines a strategy for managing funds and interacting with the MaxApy Vault within the Unlockd Protocol. It implements the IStrategy interface and provides functions for supplying funds to the MaxApy Vault, withdrawing funds from the vault, and calculating the optimal investment amount based on the strategy's configuration.
Key functions:
Returns the address of the underlying asset managed by the strategy.
Returns the configuration of the MaxApy strategy.
Returns the balance of the specified owner in the MaxApy Vault.
Parameters:
owner
: The address of the owner.
Calculates the amount to supply to the MaxApy Vault based on the current state.
Parameters:
totalSupplyNotInvested
: The total supply not invested in the vault.
from_
: The address supplying the funds.
amount_
: The amount being supplied.
Returns:
The amount to supply to the MaxApy Vault.
Supplies funds to the MaxApy Vault.
Parameters:
vault_
: The address of the MaxApy Vault.
asset_
: The address of the asset being supplied.
from_
: The address supplying the funds.
amount_
: The amount being supplied.
Returns:
The actual amount supplied to the vault.
Calculates the amount to withdraw from the MaxApy Vault based on the current state.
Parameters:
totalSupplyNotInvested_
: The total supply not invested in the vault.
from_
: The address withdrawing the funds.
amount_
: The amount being withdrawn.
Returns:
The amount to withdraw from the MaxApy Vault.
Withdraws funds from the MaxApy Vault.
Parameters:
vault_
: The address of the MaxApy Vault.
to_
: The address to receive the withdrawn funds.
amount_
: The amount being withdrawn.
Returns:
The actual amount withdrawn from the vault.
Updates the deep configuration of the strategy.
Parameters:
minAmountToInvest_
: The minimum amount to invest in the MaxApy Vault.
ratio_
: The ratio used for calculating the amount to withdraw.
Only callable by the admin role.
Updates the strategy configuration.
Parameters:
minCap_
: The minimum cap for the strategy.
percentageToInvest_
: The percentage of funds to invest in the MaxApy Vault.
Only callable by the admin role.
Last updated