LayerCover

ICapitalPool

Interface for the CapitalPool, the unified vault for underwriter capital and liquidity management.

View deployed contract addresses in the Contract Addresses section.

The ICapitalPool is the unified vault that manages underwriter capital, liquidity provisioning, and coordinates with the backstop system for claim payouts. It extends ERC4626 for standardized vault interactions.

Some legacy deployments expose depositFor(address,uint256,uint8 yieldChoice) and other legacy yield-routing helpers. The interface below reflects the current contract surface.

Interface

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

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

import {ISharedAssetController} from "./ISharedAssetController.sol";

/**
 * @title ICapitalPool
 * @notice Unified interface for CapitalPool - includes both public API and coordination functions
 */
interface ICapitalPool is IERC4626 {
    /* =========================
       ===== Admin / Config =====
       ========================= */

    function configure(Types.CapitalPoolConfig calldata config) external;

    function state() external view returns (Types.CapitalSystemState memory);

    /* ============================
       ===== Underwriter Flows =====
       ============================ */

    /// @notice UM deposits on behalf of a user and sets/uses their adapter choice.
    function depositFor(address user, uint256 amount) external;

    /// @notice Pulls assets out of CapitalPool for a syndicate withdrawal flow.
    function withdrawForSyndicate(
        address underwriter,
        uint256 assets,
        address recipient
    ) external returns (uint256 withdrawn);

    /* ==========================
       ===== Risk Operations =====
       ========================== */

    /// @notice Burns shares from an underwriter during loss charging
    function burnSharesForLoss(
        address underwriter,
        uint256 burnAmount
    ) external;

    /* =========================
       ===== View Helpers  =====
       ========================= */

    /// @notice Per-underwriter adapter selection and account summary.
    function getUnderwriterAccount(
        address underwriter
    )
        external
        view
        returns (
            uint256 currentValue,
            Types.YieldPlatform yieldChoice,
            uint256 masterShares
        );

    // unsettledPayoutShares moved to state struct inspection

    /// @notice Issues vault shares to a recipient for payout coverage (mints new shares)
    function issueSharesForPayout(
        address recipient,
        uint256 shares
    ) external returns (uint256 issued);

    /* =====================================
       ===== Coordination (PayoutManager) =====
       ===================================== */

    /// @notice Gets the idle balance available for immediate payout
    function getAvailableLiquidity() external view returns (uint256 balance);

    /// @notice Withdraws idle capital from the CapitalPool (soft-fail)
    function withdrawIdle(uint256 amount) external returns (uint256 withdrawn);

    /// @notice Records payout execution and updates unsettled shares
    function recordPayoutExecution(uint256 payoutShares) external;

    /// @notice Ensures enough idle liquidity exists by optionally drawing from backstop
    function ensureLiquidity(
        uint256 requiredAmount
    ) external returns (uint256 drawn);

    /// @notice Draws backstop liquidity directly to the caller (PayoutManager)
    function drawBackstopLiquidity(
        uint256 amount
    ) external returns (uint256 drawn);

    /// @notice Checks if adapter routing is enabled (not in emergency mode)
    function adapterRoutingEnabled() external view returns (bool enabled);

    function swapAdapterDebtForBackstopLiquidity(
        address adapter,
        uint256 deficit
    ) external returns (uint256 swapped);
}

Capital Flow


Configuration

The CapitalPool uses a bundled configuration pattern via Types.CapitalPoolConfig:

FieldTypeDescription
depositCapuint256Maximum aggregate vault deposits allowed
backstopBufferBpsuint256Buffer percentage for backstop draws
backstopMaxDrawPerCalluint256Maximum backstop draw per transaction