Maple
  • Welcome to Maple
  • Maple for Lenders
    • Introduction
    • Lending
    • Defaults and Impairments
    • Margin Calls and Liquidations
    • Risk
    • Withdrawal Process
  • syrupUSDC for Lenders
    • Powered by Maple
    • Lending in syrupUSDC and syrupUSDT
    • Commitments
    • Drips Rewards
    • Withdrawals
    • Monthly Updates
    • Pendle Integration
  • SyrupUSDC Rewards Prize Draw Program Summary
  • FAQ
  • Maple for Borrowers
    • Introduction
    • Loan Management
  • Maple for Token Holders
    • Introduction to SYRUP
      • MPL to SYRUP Conversion
      • FAQs
    • SYRUP Tokenomics
      • Staking
      • Staking Smart Contract Details
    • Governance and Voting
    • Drips Rewards
    • Research and Media
      • Podcasts
      • News Articles
      • TV Segments
      • Research Reports
      • Data Dashboards
    • Additional Resources
  • Technical Resources
    • Protocol Overview
      • Background
      • Protocol Actors
      • Smart Contract Architecture
      • Glossary
      • Smart Contract Addresses
      • Fees
      • Composability
      • Proxies and Upgradeability
    • Security
      • Security
      • List of Assumptions
      • External Entry Points
      • Emergency Protocol Pause
      • Protocol Invariants
      • Test Report
    • Loans
      • Loans
      • Fixed Term Loans
      • Open Term Loans
      • Refinancing
      • Impairments
      • Defaults
    • Pools
      • Pools
      • Pool Creation
      • PoolManager
      • PoolDelegateCover
      • Accounting
        • Pool Accounting
        • Pool Exchange Rates
    • Strategies
      • Fixed Term Loan Manager
        • Overview
        • Claims
        • Advance Payment Accounting
        • Accounting Examples
      • Open Term Loan Manager
      • DeFi Strategies
    • Withdrawal Managers
      • WithdrawalManager (Cyclical)
      • WithdrawalManager (Queue)
    • Singletons
      • Globals
      • MapleTreasury
      • Oracles
      • Pool Permission Manager
    • Admin Functions
      • Governor Admin Actions
        • Operational Admin Actions
      • Pool Delegate Admin Actions
      • Timelocks
    • Operations
      • Protocol Deployment
      • Open Term Loan Deployment
      • December 2023 Deployment & Upgrade Procedure
      • Strategies Release Deployment Procedure
    • Interfaces
      • FixedTermLoan
      • FixedTermLoanFactory
      • FixedTermLoanFeeManager
      • FixedTermLoanInitializer
      • FixedTermLoanManager
      • FixedTermLoanManagerFactory
      • FixedTermLoanManagerInitializer
      • FixedTermLoanRefinancer
      • Globals
      • Liquidator
      • LiquidatorFactory
      • LiquidatorInitializer
      • OpenTermLoan
      • OpenTermLoanFactory
      • OpenTermLoanInitializer
      • OpenTermLoanManager
      • OpenTermLoanManagerFactory
      • OpenTermLoanManagerInitializer
      • OpenTermLoanRefinancer
      • Pool
      • PoolDelegateCover
      • PoolDeployer
      • PoolManager
      • PoolManagerFactory
      • PoolManagerInitializer
      • PoolPermissionManager
      • WithdrawalManager (Cyclical)
      • WithdrawalManagerFactory (Cyclical)
      • WithdrawalManagerInitializer (Cyclical)
      • WithdrawalManager (Queue)
      • WithdrawalManagerFactory (Queue)
      • WithdrawalManagerInitializer (Queue)
    • SYRUP Token
      • Architectural Overview
      • Base ERC20 Structure
      • Upgradability
      • Modules
      • Time Locks
      • Recapitalization Module
      • Emergency Module
      • Deployment and Migration Procedure
    • GraphQL API
    • SDK
      • Introduction
      • Installation
      • Protocol Actors
      • Usage Guide
  • Troubleshooting & Support
    • Intercom
  • Maple 1.0
    • Access to deprecated Maple 1.0
  • Legal
    • Borrower MLA
    • KYC
    • Interface Terms of Use
    • Privacy Policy
    • syrupUSDC and syrupUSDT - Risks
    • syrupUSDC and syrupUSDT - Defaults and Impairments
    • syrupUSDC and syrupUSDT - Available Jurisdictions
    • Interface Terms of Use [syrupUSDC and syrupUSDT]
    • Interface Terms of Use [Syrup.fi/convert/ and Syrup.fi/stake/]
    • syrupUSDC and syrupUSDT- Privacy Policy
    • SyrupUSDC Rewards Prize Draw Terms & Conditions
Powered by GitBook
On this page
  • Functions
  • addShares
  • asset
  • cycleConfigs
  • exitCycleId
  • factory
  • getConfigAtId
  • getCurrentConfig
  • getCurrentCycleId
  • getRedeemableAmounts
  • getWindowAtId
  • getWindowStart
  • globals
  • governor
  • implementation
  • isInExitWindow
  • latestConfigId
  • lockedLiquidity
  • lockedShares
  • migrate
  • pool
  • poolDelegate
  • poolManager
  • previewRedeem
  • previewWithdraw
  • processExit
  • removeShares
  • setExitConfig
  • setImplementation
  • totalCycleShares
  • upgrade
  • Events
  • ConfigurationUpdated
  • Upgraded
  • WithdrawalCancelled
  • WithdrawalProcessed
  • WithdrawalUpdated
  1. Technical Resources
  2. Interfaces

WithdrawalManager (Cyclical)

\

Functions

addShares

Add shares to the withdrawal manager.

    function addShares(
        uint256 shares_,
        address owner_
    )
        nonpayable;

Parameters:

Index
Name
Type
Internal Type
Description

0

shares_

uint256

uint256

Amount of shares to add.

1

owner_

address

address

Address of the owner of shares.

\

asset

Gets the asset address used in this withdrawal manager.

    function asset()
        view
        returns (
            address asset_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

asset_

address

address

Address of the asset.

\

cycleConfigs

Gets the configuration for a given config id.

    function cycleConfigs(
        uint256
    )
        view
        returns (
            uint64 initialCycleId,
            uint64 initialCycleTime,
            uint64 cycleDuration,
            uint64 windowDuration
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

``

uint256

uint256

Return Values:

Index
Name
Type
Internal Type
Description

0

initialCycleId

uint64

uint64

Identifier of the first withdrawal cycle using this configuration.

1

initialCycleTime

uint64

uint64

Timestamp of the first withdrawal cycle using this configuration.

2

cycleDuration

uint64

uint64

Duration of the withdrawal cycle.

3

windowDuration

uint64

uint64

Duration of the withdrawal window.

\

exitCycleId

Gets the id of the cycle that account can exit on.

    function exitCycleId(
        address
    )
        view
        returns (
            uint256
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

``

address

address

Return Values:

Index
Name
Type
Internal Type
Description

0

uint256

uint256

\

factory

The address of the proxy factory.

    function factory()
        view
        returns (
            address factory_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

factory_

address

address

\

getConfigAtId

Gets the configuration of a given cycle id.

    function getConfigAtId(
        uint256 cycleId_
    )
        view
        returns (
            tuple config_
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

cycleId_

uint256

uint256

The id of the cycle.

Return Values:

Index
Name
Type
Internal Type
Description

0

config_

tuple

struct IMapleWithdrawalManagerStorage.CycleConfig

The configuration info corresponding to the cycle.

\

getCurrentConfig

Gets the configuration of the current cycle id.

    function getCurrentConfig()
        view
        returns (
            tuple config_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

config_

tuple

struct IMapleWithdrawalManagerStorage.CycleConfig

The configuration info corresponding to the cycle.

\

getCurrentCycleId

Gets the id of the current cycle.

    function getCurrentCycleId()
        view
        returns (
            uint256 cycleId_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

cycleId_

uint256

uint256

\

getRedeemableAmounts

Gets the shares and assets that are redeemable for a given user.

    function getRedeemableAmounts(
        uint256 lockedShares_,
        address owner_
    )
        view
        returns (
            uint256 redeemableShares_,
            uint256 resultingAssets_,
            bool partialLiquidity_
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

lockedShares_

uint256

uint256

The amount of shares that are locked.

1

owner_

address

address

The owner of the shares.

Return Values:

Index
Name
Type
Internal Type
Description

0

redeemableShares_

uint256

uint256

The amount of shares that are redeemable based on current liquidity.

1

resultingAssets_

uint256

uint256

The corresponding amount of assets that can be redeemed using the shares.

2

partialLiquidity_

bool

bool

Boolean indicating if there is enough liquidity to facilitate a full redemption.

\

getWindowAtId

Gets the timestamps of the beginning and end of the withdrawal window for a given cycle.

    function getWindowAtId(
        uint256 cycleId_
    )
        view
        returns (
            uint256 windowStart_,
            uint256 windowEnd_
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

cycleId_

uint256

uint256

The id of the current cycle.

Return Values:

Index
Name
Type
Internal Type
Description

0

windowStart_

uint256

uint256

The timestamp of the beginning of the cycle, which is the same as the beginning of the withdrawal window.

1

windowEnd_

uint256

uint256

The timestamp of the end of the withdrawal window.

\

getWindowStart

Gets the timestamp of the beginning of the withdrawal window for a given cycle.

    function getWindowStart(
        uint256 cycleId_
    )
        view
        returns (
            uint256 windowStart_
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

cycleId_

uint256

uint256

The id of the current cycle.

Return Values:

Index
Name
Type
Internal Type
Description

0

windowStart_

uint256

uint256

The timestamp of the beginning of the cycle, which is the same as the beginning of the withdrawal window.

\

globals

Gets the address of globals.

    function globals()
        view
        returns (
            address globals_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

globals_

address

address

The address of globals.

\

governor

Gets the address of the governor.

    function governor()
        view
        returns (
            address governor_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

governor_

address

address

The address of the governor.

\

implementation

The address of the implementation contract being proxied.

    function implementation()
        view
        returns (
            address implementation_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

implementation_

address

address

\

isInExitWindow

Checks if an account is included in an exit window.

    function isInExitWindow(
        address owner_
    )
        view
        returns (
            bool isInExitWindow_
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

owner_

address

address

The address of the share owners to check.

Return Values:

Index
Name
Type
Internal Type
Description

0

isInExitWindow_

bool

bool

A boolean indicating whether or not the account is in an exit window.

\

latestConfigId

Gets the most recent configuration id.

    function latestConfigId()
        view
        returns (
            uint256
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

uint256

uint256

\

lockedLiquidity

Gets the total amount of funds that need to be locked to fulfill exits.

    function lockedLiquidity()
        view
        returns (
            uint256 lockedLiquidity_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

lockedLiquidity_

uint256

uint256

The amount of locked liquidity.

\

lockedShares

Gets the amount of locked shares for an account.

    function lockedShares(
        address
    )
        view
        returns (
            uint256
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

``

address

address

Return Values:

Index
Name
Type
Internal Type
Description

0

uint256

uint256

\

migrate

Modifies the proxy's storage by delegate-calling a migrator contract with some arguments. Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.

    function migrate(
        address migrator_,
        bytes arguments_
    )
        nonpayable;

Parameters:

Index
Name
Type
Internal Type
Description

0

migrator_

address

address

The address of a migrator contract.

1

arguments_

bytes

bytes

Some encoded arguments to use for the migration.

\

pool

Gets the address of the pool associated with this withdrawal manager.

    function pool()
        view
        returns (
            address
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

address

address

\

poolDelegate

Gets the pool delegate address.

    function poolDelegate()
        view
        returns (
            address poolDelegate_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

poolDelegate_

address

address

Address of the pool delegate.

\

poolManager

Gets the address of the pool manager associated with this withdrawal manager.

    function poolManager()
        view
        returns (
            address
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

address

address

\

previewRedeem

Gets the amount of shares that can be redeemed.

    function previewRedeem(
        address owner_,
        uint256 shares_
    )
        view
        returns (
            uint256 redeemableShares_,
            uint256 resultingAssets_
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

owner_

address

address

The address to check the redemption for.

1

shares_

uint256

uint256

The amount of requested shares to redeem.

Return Values:

Index
Name
Type
Internal Type
Description

0

redeemableShares_

uint256

uint256

The amount of shares that can be redeemed.

1

resultingAssets_

uint256

uint256

The amount of assets that will be returned for `redeemableShares`.

\

previewWithdraw

Gets the amount of shares that can be withdrawn.

    function previewWithdraw(
        address owner_,
        uint256 assets_
    )
        pure
        returns (
            uint256 redeemableAssets_,
            uint256 resultingShares_
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

owner_

address

address

The address to check the withdrawal for.

1

assets_

uint256

uint256

The amount of requested shares to withdraw.

Return Values:

Index
Name
Type
Internal Type
Description

0

redeemableAssets_

uint256

uint256

The amount of assets that can be withdrawn.

1

resultingShares_

uint256

uint256

The amount of shares that will be burned.

\

processExit

Process the exit of an account.

    function processExit(
        uint256 requestedShares_,
        address owner_
    )
        nonpayable
        returns (
            uint256 redeemableShares_,
            uint256 resultingAssets_
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

requestedShares_

uint256

uint256

Amount of initially requested shares.

1

owner_

address

address

Address of the account which will be processed for exit.

Return Values:

Index
Name
Type
Internal Type
Description

0

redeemableShares_

uint256

uint256

1

resultingAssets_

uint256

uint256

\

removeShares

Remove shares to the withdrawal manager.

    function removeShares(
        uint256 shares_,
        address owner_
    )
        nonpayable
        returns (
            uint256 sharesReturned_
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

shares_

uint256

uint256

Amount of shares to remove.

1

owner_

address

address

Address of the owner of shares.

Return Values:

Index
Name
Type
Internal Type
Description

0

sharesReturned_

uint256

uint256

\

setExitConfig

Sets up a new exit configuration.

    function setExitConfig(
        uint256 cycleDuration_,
        uint256 windowDuration_
    )
        nonpayable;

Parameters:

Index
Name
Type
Internal Type
Description

0

cycleDuration_

uint256

uint256

The total duration, in seconds, of a withdrawal cycle.

1

windowDuration_

uint256

uint256

The duration, in seconds, of the withdrawal window.

\

setImplementation

Modifies the proxy's implementation address.

    function setImplementation(
        address implementation_
    )
        nonpayable;

Parameters:

Index
Name
Type
Internal Type
Description

0

implementation_

address

address

\

totalCycleShares

Gets the amount of shares for a cycle.

    function totalCycleShares(
        uint256
    )
        view
        returns (
            uint256
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

``

uint256

uint256

Return Values:

Index
Name
Type
Internal Type
Description

0

uint256

uint256

\

upgrade

Upgrades a contract implementation to a specific version. Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.

    function upgrade(
        uint256 version_,
        bytes arguments_
    )
        nonpayable;

Parameters:

Index
Name
Type
Internal Type
Description

0

version_

uint256

uint256

1

arguments_

bytes

bytes

Some encoded arguments to use for the upgrade.

\

Events

ConfigurationUpdated

    event ConfigurationUpdated(
        uint256 configId_,
        uint64 initialCycleId_,
        uint64 initialCycleTime_,
        uint64 cycleDuration_,
        uint64 windowDuration_
    );

Parameters:

Index
Name
Type
Internal Type
Description

0

configId_

uint256

uint256

1

initialCycleId_

uint64

uint64

2

initialCycleTime_

uint64

uint64

3

cycleDuration_

uint64

uint64

4

windowDuration_

uint64

uint64

\

Upgraded

The instance was upgraded.

    event Upgraded(
        uint256 toVersion_,
        bytes arguments_
    );

Parameters:

Index
Name
Type
Internal Type
Description

0

toVersion_

uint256

uint256

The new version of the loan.

1

arguments_

bytes

bytes

The upgrade arguments, if any.

\

WithdrawalCancelled

    event WithdrawalCancelled(
        address account_
    );

Parameters:

Index
Name
Type
Internal Type
Description

0

account_

address

address

\

WithdrawalProcessed

    event WithdrawalProcessed(
        address account_,
        uint256 sharesToRedeem_,
        uint256 assetsToWithdraw_
    );

Parameters:

Index
Name
Type
Internal Type
Description

0

account_

address

address

1

sharesToRedeem_

uint256

uint256

2

assetsToWithdraw_

uint256

uint256

\

WithdrawalUpdated

    event WithdrawalUpdated(
        address account_,
        uint256 lockedShares_,
        uint64 windowStart_,
        uint64 windowEnd_
    );

Parameters:

Index
Name
Type
Internal Type
Description

0

account_

address

address

1

lockedShares_

uint256

uint256

2

windowStart_

uint64

uint64

3

windowEnd_

uint64

uint64

\

PreviousPoolPermissionManagerNextWithdrawalManagerFactory (Cyclical)

Last updated 6 months ago