    /// @notice Retrieves the current balance of the managed asset in the Morpho protocol.
    /// @return The current balance of the managed asset.
    function _getBalance() internal view override returns (uint256) {
        return _morpho.expectedSupplyAssets(_marketParams, address(this));
    }
    function _undeploy(uint256 amount) internal override returns (uint256) {
        Id id = _marketParams.id();
        uint256 assetsWithdrawn = 0;
        uint256 totalSupplyAssets = _morpho.totalSupplyAssets(id);
        uint256 totalSupplyShares = _morpho.totalSupplyShares(id);

        uint256 shares = _morpho.supplyShares(id, address(this));
        uint256 assetsMax = shares.toAssetsDown(totalSupplyAssets, totalSupplyShares);

        if (amount >= assetsMax) {
            (assetsWithdrawn, ) = _morpho.withdraw(_marketParams, 0, shares, address(this), address(this));
        } else {
            (assetsWithdrawn, ) = _morpho.withdraw(_marketParams, amount, 0, address(this), address(this));
        }

        return assetsWithdrawn;
    }
    function _undeploy(uint256 amount) internal override returns (uint256) {
        Id id = _marketParams.id();
        uint256 assetsWithdrawn = 0;
-       uint256 totalSupplyAssets = _morpho.totalSupplyAssets(id);
-       uint256 totalSupplyShares = _morpho.totalSupplyShares(id);

-       uint256 shares = _morpho.supplyShares(id, address(this));
-       uint256 assetsMax = shares.toAssetsDown(totalSupplyAssets, totalSupplyShares);
+       uint256 assetsMax = _morpho.expectedSupplyAssets(_marketParams, address(this));

        if (amount >= assetsMax) {
            (assetsWithdrawn, ) = _morpho.withdraw(_marketParams, 0, shares, address(this), address(this));
        } else {
            (assetsWithdrawn, ) = _morpho.withdraw(_marketParams, amount, 0, address(this), address(this));
        }

        return assetsWithdrawn;
    }
