// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.13; import "@equilibria/root/number/types/UFixed18.sol"; import "@equilibria/root/number/types/Fixed18.sol"; import "@equilibria/root/token/types/Token18.sol"; import "./IController.sol"; import "./IProduct.sol"; interface ICollateral { event Deposit(address indexed user, IProduct indexed product, UFixed18 amount); event Withdrawal(address indexed user, IProduct indexed product, UFixed18 amount); event AccountSettle(IProduct indexed product, address indexed account, Fixed18 amount, UFixed18 newShortfall); event ProductSettle(IProduct indexed product, UFixed18 protocolFee, UFixed18 productFee); event Liquidation(address indexed user, IProduct indexed product, address liquidator, UFixed18 fee); event ShortfallResolution(IProduct indexed product, UFixed18 amount); event FeeClaim(address indexed account, UFixed18 amount); error CollateralCantLiquidate(UFixed18 totalMaintenance, UFixed18 totalCollateral); error CollateralInsufficientCollateralError(); error CollateralUnderLimitError(); error CollateralZeroAddressError(); error CollateralAccountLiquidatingError(address account); function token() external view returns (Token18); function fees(address account) external view returns (UFixed18); function initialize(IController controller_) external; function depositTo(address account, IProduct product, UFixed18 amount) external; function withdrawTo(address receiver, IProduct product, UFixed18 amount) external; function withdrawFrom(address account, address receiver, IProduct product, UFixed18 amount) external; function liquidate(address account, IProduct product) external; function settleAccount(address account, Fixed18 amount) external; function settleProduct(UFixed18 amount) external; function collateral(address account, IProduct product) external view returns (UFixed18); function collateral(IProduct product) external view returns (UFixed18); function shortfall(IProduct product) external view returns (UFixed18); function liquidatable(address account, IProduct product) external view returns (bool); function liquidatableNext(address account, IProduct product) external view returns (bool); function resolveShortfall(IProduct product, UFixed18 amount) external; function claimFee() external; }