Protect Strategy
Technical documentation
Description
The Protect Strategy is responsible for providing funds to Concrete's Borrow Flow, working in conjunction with the claim router. Additionally, this strategy serves as a buffer, as the funds transferred from the vault are intended to cover borrow claims.
Yield Accrual
This strategy receives rewards from borrow flow claim fees. In the case of multiple vaults of the same token with the protect strategy, the rewards are distributed based on the proportion of tokens lent.
Functions
isProtection
function isProtectStrategy() external pure returns (bool)
This function returns whether the strategy is a protect strategy or not. For protect strategies, the returned value is always true.
getAvailableAssetsForWithdrawal
function getAvailableAssetsForWithdrawal() public view returns (uint256)
This function returns the balance of the contract in the underlying asset.
setClaimRouter
function setClaimRouter(address claimRouter_) external onlyOwner
This function sets a new Claim Router address. It's only callable by the owner.
totalAssets
function totalAssets() public view returns (uint256)
This function returns the balance of the contract in the underlying asset, plus the amount of tokens lent to the borrow flow.
getBorrowDebt
function getBorrowDebt() public view returns (uint256)
This function returns the amount of tokens lent to the borrow flow.
updateBorrowDebt
function updateBorrowDebt(uint256 amount) external onlyClaimRouter
This function reduce the amount of tokens lent to the borrow flow. It's only callable by the ClaimRouter contract.
executeBorrowClaim
function executeBorrowClaim(uint256 amount, address recipient) external override onlyClaimRouter {
This function transfers the requested amount to the recipient. If the strategy doesn't have enough funds to cover the claim, it will call the internal function _requestFromVault
to request funds from the vault and other strategies. It's only callable by the ClaimRouter contract.
_requestFromVault
function _requestFromVault(uint256 amount_) private
This function requests funds from the vault and other strategies. It executes the required withdrawals from other strategies on the vault and deposits the funds into the protect strategy.
Last updated