Skip to main content

FutureVault

Main Future abstraction contract. This contract can be extended for platform-specific implementations, with pre-defined presets to be released by the APWine team at launch.

pragma solidity 0.7.6;
interface IFutureVault {
    /* Events */
    event NewPeriodStarted(uint256 _newPeriodIndex);    event FutureWalletSet(address _futureWallet);    event FundsDeposited(address _user, uint256 _amount);    event FundsWithdrawn(address _user, uint256 _amount);    event APWIBTSet(address _apwibt);    event LiquidityTransfersPaused();    event LiquidityTransfersResumed();    event DelegationCreated(address _delegator, address _receiver, uint256 _amount);    event DelegationRemoved(address _delegator, address _receiver, uint256 _amount);
    /* Params */    /**     * @notice Getter for the PERIOD future parameter     * @return returns the period duration of the future     */    function PERIOD_DURATION() external view returns (uint256);
    /**     * @notice Getter for the PLATFORM_NAME future parameter     * @return returns the platform of the future     */    function PLATFORM_NAME() external view returns (string memory);
    /**     * @notice Send the user their owed FYT (and apwibt if there are some claimable)     * @param _user address of the user to send the FYT to     */    function claimFYT(address _user, uint256 _amount) external;
    /**     * @notice Update the state of the user and mint claimable apwibt     * @param _user user adress     */    function updateUserState(address _user) external;
    /* Getters */
    /**     * @notice Getter the total number of FYTs on address is delegating     * @param _delegator the delegating address     * @return the number of FYTs delegated     */    function getTotalDelegated(address _delegator) external view returns (uint256);
    /**     * @notice Getter for next period index     * @return next period index     * @dev index starts at 1     */    function getNextPeriodIndex() external view returns (uint256);
    /**     * @notice Getter for current period index     * @return current period index     * @dev index starts at 1     */    function getCurrentPeriodIndex() external view returns (uint256);
    /**     * @notice Getter for the amount of apwibt that the user can claim     * @param _user user to check the check the claimable apwibt of     * @return the amount of apwibt claimable by the user     */    function getClaimableAPWIBT(address _user) external view returns (uint256);
    /**     * @notice Getter for the amount (in underlying) of premium redeemable with the corresponding amount of fyt/apwibt to be burned     * @param _user user adress     * @return premiumLocked the premium amount unlockage at this period (in underlying), amountRequired the amount of apwibt/fyt required for that operation     */    function getUserEarlyUnlockablePremium(address _user)        external        view        returns (uint256 premiumLocked, uint256 amountRequired);
    /**     * @notice Getter for user IBT amount that is unlockable     * @param _user the user to unlock the IBT from     * @return the amount of IBT the user can unlock     */    function getUnlockableFunds(address _user) external view returns (uint256);
    /**     * @notice Getter for the amount of FYT that the user can claim for a certain period     * @param _user the user to check the claimable FYT of     * @param _periodIndex period ID to check the claimable FYT of     * @return the amount of FYT claimable by the user for this period ID     */    function getClaimableFYTForPeriod(address _user, uint256 _periodIndex) external view returns (uint256);
    /**     * @notice Getter for the yield currently generated by one apwibt for the current period     * @return the amount of yield (in IBT) generated during the current period     */    function getUnrealisedYieldPerAPWIBT() external view returns (uint256);
    /**     * @notice Getter for the number of apwibt that can be minted for an amoumt deposited now     * @param _amount the amount to of IBT to deposit     * @return the number of apwibt that can be minted for that amount     */    function getAPWIBTPerAmountDeposited(uint256 _amount) external view returns (uint256);
    /**     * @notice Getter for premium in underlying tokens that can be redeemed at the end of the period of the deposit     * @param _amount the amount of underlying deposited     * @return the number of underlying of the ibt deposited that will be redeemable     */    function getPremiumPerUnderlyingDeposited(uint256 _amount) external view returns (uint256);
    /**     * @notice Getter for total underlying deposited in the vault     * @return the total amount of funds deposited in the vault (in underlying)     */    function getTotalUnderlyingDeposited() external view returns (uint256);
    /**     * @notice Getter for controller address     * @return the controller address     */    function getControllerAddress() external view returns (address);
    /**     * @notice Getter for futureWallet address     * @return futureWallet address     */    function getFutureWalletAddress() external view returns (address);
    /**     * @notice Getter for the IBT address     * @return IBT address     */    function getIBTAddress() external view returns (address);
    /**     * @notice Getter for future apwibt address     * @return apwibt address     */    function getAPWIBTAddress() external view returns (address);
    /**     * @notice Getter for FYT address of a particular period     * @param _periodIndex period index     * @return FYT address     */    function getFYTofPeriod(uint256 _periodIndex) external view returns (address);
    /**     * @notice Getter for the terminated state of the future     * @return true if this vault is terminated     */    function isTerminated() external view returns (bool);
    /**     * @notice Getter for the performance fee factor of the current period     * @return the performance fee factor of the futureVault     */    function getPerformanceFeeFactor() external view returns (uint256);