LayerCover

IYieldStrategyManager

Interface for managing external yield strategies.

View deployed contract addresses in the Contract Addresses section.

The IYieldStrategyManager is responsible for routing idle capital from the CapitalPool to external yield protocols (e.g., Aave, Compound). It manages the "Base Yield" component of the system and handles adapter lifecycle management.

Interface

// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.20;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IRewardDistributor} from "./IRewardDistributor.sol";
import {Types} from "../libraries/helpers/Types.sol";

/**
 * @title IYieldStrategyManager
 * @notice Interface for adapter lifecycle management and underwriter yield accounting.
 */
interface IYieldStrategyManager {
    /* ========= Admin ========= */

    function setBaseYieldAdapter(
        Types.YieldPlatform platform,
        address adapterAddress
    ) external;

    function deactivateBaseYieldAdapter(address adapterAddress) external;

    function setYieldAdapterRewardPool(
        address adapterAddress,
        uint256 rewardPoolId
    ) external;

    function markAdapterFailed(
        address adapterAddress,
        string calldata reason
    ) external;

    function markAdapterRecovered(address adapterAddress) external;

    /* ========= Capital flows ========= */

    function invest(
        address user,
        uint256 amount,
        Types.YieldPlatform choice
    ) external returns (uint256 invested);

    function harvestAndDistributeYield(
        address adapterAddress
    ) external returns (uint256 distributed);

    function withdrawFor(
        address user,
        uint256 amount,
        address recipient
    ) external returns (uint256 withdrawn);

    function withdrawFromAdapter(
        address strategy,
        address recipient,
        uint256 amount
    ) external returns (uint256 received);

    function withdrawLiquidity(
        uint256 amount,
        address recipient
    ) external returns (uint256 withdrawn);

    function syncAdapterEmergencyTransfer(
        address adapter,
        uint256 valueLost,
        bool markFailed
    ) external;

    function recordLoss(
        address user,
        uint256 burnShares,
        uint256 userShareBalanceBefore
    ) external returns (uint256 principalReduced);

    function transferPrincipalToBackstop(
        address adapter,
        uint256 amount
    ) external;

    function claimReinsuranceDebt(
        address adapter
    ) external returns (uint256 recovered);

    function snapshotAdapterValue(address adapter) external returns (uint256);

    /* ========= Views ========= */

    function asset() external view returns (IERC20);

    function capitalPool() external view returns (address);

    function rewardDistributor() external view returns (IRewardDistributor);

    function getActiveYieldAdapters() external view returns (address[] memory);

    // function totalInvested() external view returns (uint256); // Moved to PoolViewer
    function getUnderwriterYieldState(
        address user
    ) external view returns (Types.UnderwriterYieldState memory);

    function getPrincipalInAdapter(
        address adapter
    ) external view returns (uint256);

    function isAdapterActive(address adapter) external view returns (bool);

    function isAdapterFailed(address adapter) external view returns (bool);
}

Yield Flow


Adapter States

StateDescriptionCan DepositCan Withdraw
ActiveNormal operation
DeactivatedGraceful shutdown
FailedEmergency state⚠️ Limited
RecoveredBack to normal