BaseSommerlierStrategy
The BaseSommelierStrategy
contract is a specialized implementation specifically designed for interacting with Sommelier Cellars. It extends the contract's functionality to handle the specific requirements of Sommelier Cellars.
This contract's main purpose is to enable the MaxAPY Protocol to invest funds in Sommelier Cellars and earn yield. It provides functions for depositing underlying assets into the Cellar Vault, withdrawing funds, and managing the strategy's position.
The BaseSommelierStrategy
contract overrides and extends certain functions from the BaseStrategy
contract to adapt to the specific needs of interacting with Sommelier Cellars, such as calculating share values, estimating total assets, and handling investments and divestments.
By leveraging the yield-generating capabilities of Sommelier Cellars, the BaseSommelierStrategy
the contract allows the maxAPY Protocol to optimize user returns and expand the range of yield-generating opportunities available.
Functions
initialize()
Initializes the BaseSommelierStrategy with the specified vault, keepers, strategy name, strategist, and Sommelier Cellar.
Parameters:
_vault
: The address of the MaxApy Vault associated with the strategy
_keepers
: The addresses of the keepers to be added as valid keepers to the strategy
_strategyName
: The name of the strategy
_cellar
: The address of the Sommelier Turbo-stETH cellar
_invest()
Invests amount
of underlying, depositing it in the Cellar Vault.
Parameters:
amount
: The amount of underlying to be deposited in the vault
minOutputAfterInvestment
: Minimum expected output after _invest()
(designated in Cellar receipt tokens)
Returns:
depositedAmount
: The amount of shares received, in terms of underlying
_divest()
Divests amount shares
from Cellar Vault.
Parameters:
shares
: The amount of shares to divest
Returns:
withdrawn
: The total amount divested, in terms of underlying asset
_shareValue()
Determines the current value of shares
.
Parameters:
shares
: The number of shares to calculate the value for
Returns:
_assets
: The estimated amount of underlying computed from the shares
_sharesForAmount()
Determines how many shares a depositor of amount
of underlying would receive.
Parameters:
amount
: The amount of underlying assets
Returns:
_shares
: The estimated amount of shares computed in exchange for the underlying amount
_shareBalance()
Returns the current strategy's amount of Cellar vault shares.
Returns:
_balance
: The strategy's balance of Cellar Vault shares
_estimatedTotalAssets()
Returns the real-time estimation of the value in assets held by the strategy.
Returns:
The strategy's total assets (idle + investment positions)
Last updated