Skip to content

Glossary

Lucas Manuel edited this page Dec 20, 2021 · 11 revisions

Smart Contracts

  • LoanLib: External library that performs calculations for Loan.
  • PoolLib: External library that performs calculations for Pool.
  • Util: External library that calculates minAmount for Uniswap trades.
  • SafeMathInt: SafeMath library.
  • SafeMathUint: SafeMath library.
  • ChainlinkOracle: Wrapper for Chainlink oracles that allows for manual price overrides.
  • UsdOracle: Constant USD price oracle.
  • BasicFDT: Basic FDT implementation for revenue, abstract.
  • ExtendedFDT: Extension of FDT that accounts for losses, abstract.
  • FDT: ERC-2222 token for distributing funds to token holders.
  • LoanFDT: Loan inheritance of BasicFDT.
  • PoolFDT: Pool inheritance of ExtendedFDT.
  • StakeLockerFDT: StakeLocker inheritance of ExtendedFDT.
  • CollateralLocker: Holds custody of collateral for Loans.
  • CollateralLockerFactory: Deploys CollateralLockers.
  • DebtLocker: Holds custody of LoanFDT tokens on behalf of Pools.
  • DebtLockerFactory: Deploys DebtLockers.
  • FundingLocker: Holds custody of funds from Pools for Loans, before a drawdown is made.
  • FundingLockerFactory: Deploys FundingLockers.
  • LateFeeCalc: Calculates late fee payments for Loans.
  • LiquidityLocker: Holds custody of the liquidityAsset of a Pool.
  • LiquidityLockerFactory: Deploys LiquidityLockers.
  • Loan: Contains all logic for funding, drawing down, making payments, and defaulting on loans. Issues FDT tokens to Loan funders so they make claims.
  • LoanFactory: Deploys Loans.
  • MapleGlobals: Central contract for managing allowlists (factories, pool delegates, calculators, assets) and general parameters for the protocol. Controlled by the governor multisig.
  • MapleToken: MPL token. Inherits FDT so that it can distribute funds from the treasury.
  • MapleTreasury: Treasury that collects fees denominated in the loanAsset, converts them to USDC and then transfers to the MapleToken.
  • Pool: Contains all logic for LP deposits, withdrawals, Pool funding, claiming, all accounting related to Pool.
  • PoolFactory: Deploys Pools.
  • PremiumCalc: Calculates premium payment if entire loan is paid back early.
  • RepaymentCalc: Calculates payments for Loans.
  • StakeLocker: Holds custody of staked MPL/loanAsset BPTs, to be used to burn and recover liquidityAsset in the case of a shortfall after liquidation during a default.
  • StakeLockerFactory: Deploys StakeLockers.
  • MplRewards: Fork of SNX liquidity mining contract, to be used to reward LPs with MPL.
  • MplRewardsFactory: Deploys MplRewards contracts.

Terminology/Variables

Tokens

  • collateralAsset: ERC-20 contract of asset used as collateral for Loans.
  • liquidityAsset: ERC-20 contract of asset used as liquidity for Pools.
  • stakeAsset: ERC-20 contract of Balance Pool Tokens (BPTs) used for staking.
  • BPT: Balancer Pool Token.
  • FDT: Funds Distribution Token - used to distributed gains/losses to token holders.
  • LoanFDT: FDT issued to Loan lenders to claim funds from Loan.
  • PoolFDT: FDT issued to Pool Liquidity Providers to register gains/losses from a Pool.
  • StakeLockerFDT: FDT issued to Pool Stakers to register gains/losses from a StakeLocker.

Accounting - LoanV1

  • apr: APR in basis points.
  • paymentsRemaining: Number of payments remaining on the Loan.
  • termDays: Total length of the Loan term in days.
  • paymentIntervalSeconds: Time between Loan payments in seconds.
  • requestAmount: Total requested amount for Loan.
  • collateralRatio: Percentage of value of drawdown amount to post as collateral in basis points.
  • fundingPeriod: Time for a Loan to be funded in seconds.
  • defaultGracePeriod: Represents the amount of time a borrower has to make a missed payment before a default can be triggered.
  • createdAt: Timestamp of when Loan was instantiated.
  • principalOwed: The principal owed (initially the drawdown amount).
  • principalPaid: Amount of principal that has been paid by borrower since Loan instantiation.
  • interestPaid: Amount of interest that has been paid by borrower since Loan instantiation.
  • feePaid: Amount of fees that have been paid by borrower since Loan instantiation.
  • excessReturned: Amount of excess that has been returned to lenders after Loan drawdown.
  • amountLiquidated: Amount of collateral that has been liquidated after default.
  • amountRecovered: Amount of liquidityAsset that has been recovered after default.
  • defaultSuffered: Difference between amountRecovered and principalOwed after liquidation.
  • liquidationExcess: If amountRecovered > principalOwed, amount of liquidityAsset that is to be returned to borrower.

Accounting - PoolV1

  • principalOut: Sum of all outstanding principal on Loans.
  • stakingFee: Fee for stakers (in basis points).
  • delegateFee: Fee for delegates (in basis points).
  • principalPenalty: Max penalty on principal in basis points on early withdrawal.
  • penaltyDelay: Time until total interest and principal is available after a deposit, in seconds.
  • liquidityCap: Amount of liquidity tokens accepted by the Pool.
  • lockupPeriod: Unix timestamp during which withdrawal is not allowed.

Maple Globals

  • governor: Governor is responsible for management of global Maple variables.
  • mpl: Maple Token is the ERC-2222 token for the Maple protocol.
  • mapleTreasury: Maple Treasury is the Treasury which all fees pass through for conversion, prior to distribution.
  • globalAdmin: Admin of the whole network, has the power to switch off/on the functionality of entire protocol.
  • defaultGracePeriod: Represents the amount of time a borrower has to make a missed payment before a default can be triggered.
  • swapOutRequired: Represents minimum amount of Pool cover that a Pool Delegate has to provide before they can finalize a Pool.
  • unstakeDelay: Parameter for unstake delay with relation to StakeLocker withdrawals.
  • fundingPeriod: Amount of time to allow borrower to drawdown on their loan after funding period ends.
  • investorFee: Portion of drawdown that goes to Pool Delegates.
  • treasuryFee: Portion of drawdown that goes to MapleTreasury.
  • minLoanEquity: Minimum amount of LoanFDTs required to trigger liquidations (basis points percentage of totalSupply).
  • stakerCooldownPeriod: Period (in secs) after which stakers are allowed to unstake their BPTs from the StakeLocker contract.
  • lpCooldownPeriod: Period (in secs) after which LPs are allowed to withdraw their funds from the Pool contract.
  • stakerUnstakeWindow: Window of time (in secs) after stakerCooldownPeriod that a user has to withdraw before their intent to unstake is invalidated.
  • lpWithdrawWindow: Window of time (in secs) after lpCooldownPeriod that a user has to withdraw before their intent to withdraw is invalidated.
  • maxSwapSlippage: Maximum amount of slippage for Uniswap transactions.
  • protocolPaused: Switch to paused the functionality of the entire protocol.
  • isValidLiquidityAsset: Mapping of valid liquidityAssets.
  • isValidCollateralAsset: Mapping of valid collateralAssets.
  • validCalcs: Mapping of valid calculator contracts.
  • isValidPoolDelegate: Validation data structure for Pool Delegates (prevent invalid addresses from creating pools).
  • defaultUniswapPath: Determines the liquidation path of various assets in Loans and Treasury.
  • oracleFor: Chainlink oracle for a given asset.
  • isValidPoolFactory: Mapping of valid pool factories.
  • isValidLoanFactory: Mapping of valid loan factories.
  • validSubFactories: Mapping of valid sub factories.