Core Integration
Overview
Term Strategy integrates seamlessly with Yearn V3's vault mechanics by implementing the three required BaseStrategy hooks: _deployFunds
, _freeFunds
, and _harvestAndReport
. These hooks enable Term Strategy Vaults to manage deposits, withdrawals, and portfolio valuation while aligning with Yearn's operational framework.
Required BaseStrategy Hooks
_deployFunds
: Handles deposit management._freeFunds
: Manages withdrawals._harvestAndReport
: Calculates total portfolio value for profit and share accounting.
Deposit Management (_deployFunds)
The _deployFunds
function sweeps idle assets and redeems matured loans for deployment into fixed-rate loans on Term. The implementation ensures efficient use of capital while maintaining compatibility with Yearn's vault mechanics.
Term Strategy Vault Implementation:
Redeem Matured Loans: Automatically redeems any matured loans first.
Sweep Idle Assets: Deposited and idle assets are swept into the idle liquidity vault pending deployment.
_redeemRepoTokens()
is a helper method that redeems matured loans and sweeps idle assets (if any) into the idle asset vault pending deployment into fixed rate loans on Term.
Withdrawal Management (_freeFunds)
The _freeFunds
function facilitates withdrawals by redeeming matured loans and withdrawing the requested funds from the idle liquidity vault. Like _deployFunds
, it leverages _redeemRepoTokens()
to automate portfolio adjustments.
Term Strategy Vault Implementation:
Redeem Matured Loans: Withdrawals prioritize the redemption of matured loans.
Withdraw Requested Funds: Required amounts are withdrawn from the idle liquidity vault.
_redeemRepoTokens()
is a helper method that redeems matured loans, withdraws requested funds and sweeps idle assets (if any) into the idle asset vault pending deployment into fixed rate loans on Term. This implementation:
Portfolio Reporting and Valuation (_harvestAndReport)
The _harvestAndReport
function calculates the total portfolio value, which is critical for vault profit and share accounting. It redeems matured loans and sweeps assets for comprehensive portfolio valuation.
Term Strategy Vault Implementation:
Redeem Matured Positions: Sweeps and redeems matured loans.
Calculate Total Value: Returns
_totalAssetValue
, which includes:Present value of all Term repoTokens.
Present value of open auction offers.
Liquidity Management: Tends to the portfolio during valuation by leveraging
_redeemRepoTokens()
.
_redeemRepoTokens()
is a helper method that redeems matured loans and sweeps idle assets (if any) into the idle asset vault pending deployment into fixed rate loans on Term. This implementation of _harvestAndReport():
Last updated