Skip to content

Lockers

Michael De Luca edited this page May 3, 2021 · 5 revisions

In order to allow for a higher degree of modularity and flexibility in the creation/management of Pools and Loans in the Maple protocol, an architectural decision was made to use dedicated smart contracts (referred to as "Lockers") to hold custody of assets. There are five types of Lockers in the Maple protocol:

  • Pool
    • LiquidityLocker: Holds custody of the ERC-20 asset used for liquidity for funding Loans.
    • DebtLocker: Holds custody of LoanFDTs, used to claim revenue from Loans and make permissioned calls for liquidations, covered in more detail here.
    • StakeLocker: Holds custody of BPTs, used as a reserve to cover losses from defaulted Loans.
  • Loan
    • FundingLocker: Holds custody of the ERC-20 asset used for borrowing during the funding period (pre-drawdown)
    • CollateralLocker: Holds custody of the ERC-20 asset used as collateral against the Loan.

The reason that this Locker architecture is used is to allow for Pools and Loans to develop different "strategies" with these contracts. In the first iteration of the protocol, these contracts will be used exclusively for custody of assets, meaning the assets will never leave the contract. However in future iterations of the protocol they can be used for different reasons. One example of this would be to lend out the idle collateral in the CollateralLocker to earn additional interest over the term of a Loan.

In order for any new Locker strategy to be implemented, its corresponding Factory must be whitelisted in MapleGlobals using setValidSubFactory. This ensures that every Locker strategy has been audited and vetted by the Maple smart contracts team and is considered to be safe for use.