Maple
Search…
Globals
MapleGlobals maintains a central source of parameters and allowlists for the Maple protocol.

Constructor

Constructor function. It emits an `Initialized` event.
1
constructor(
2
address _governor,
3
address _mpl,
4
address _globalAdmin
5
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
_governor
address
address
Address of Governor.
1
_mpl
address
address
Address of the ERC-2222 Maple Token for the Maple protocol.
2
_globalAdmin
address
address
Address the Global Admin.

Functions

acceptGovernor

Accept the Governor position. Only the Pending Governor can call this function. It emits a `GovernorAccepted` event.
1
function acceptGovernor(
2
) nonpayable
Copied!

defaultGracePeriod (state variable)

The amount of time a Borrower has to make a missed payment before a default can be triggered.
1
function defaultGracePeriod(
2
) view returns (
3
uint256
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256

defaultUniswapPath (state variable)

Determines the liquidation path of various assets in Loans and the Treasury. The value provided will determine whether or not to perform a bilateral or triangular swap on Uniswap. For example, `defaultUniswapPath[WBTC][USDC]` value would indicate what asset to convert WBTC into before conversion to USDC. If `defaultUniswapPath[WBTC][USDC] == USDC`, then the swap is bilateral and no middle asset is swapped. If `defaultUniswapPath[WBTC][USDC] == WETH`, then swap WBTC for WETH, then WETH for USDC.
1
function defaultUniswapPath(
2
address,
3
address
4
) view returns (
5
address
6
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
``
address
address
1
``
address
address

Return Values:

Index
Name
Type
Internal Type
Description
0
address
address
The intermediary asset for swaps, if any.

fundingPeriod (state variable)

The amount of time to allow a Borrower to drawdown on their Loan after funding period ends.
1
function fundingPeriod(
2
) view returns (
3
uint256
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256

getLatestPrice

Fetch price for asset from Chainlink oracles.
1
function getLatestPrice(
2
address asset
3
) view returns (
4
uint256
5
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
asset
address
address
The asset to fetch the price of.

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256
The price of asset in USD.

getLpCooldownParams

Returns the `lpCooldownPeriod` and `lpWithdrawWindow` as a tuple, for convenience.
1
function getLpCooldownParams(
2
) view returns (
3
uint256,
4
uint256
5
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256
The value of `lpCooldownPeriod`.
1
uint256
uint256
The value of `lpWithdrawWindow`.

globalAdmin (state variable)

The Global Admin of the whole network. Has the power to switch off/on the functionality of entire protocol.
1
function globalAdmin(
2
) view returns (
3
address
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
address
address

governor (state variable)

The Governor responsible for management of global Maple variables.
1
function governor(
2
) view returns (
3
address
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
address
address

investorFee (state variable)

The portion of drawdown that goes to the Pool Delegates and individual Lenders.
1
function investorFee(
2
) view returns (
3
uint256
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256

isValidBalancerPool (state variable)

1
function isValidBalancerPool(
2
address
3
) view returns (
4
bool
5
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
``
address
address

Return Values:

Index
Name
Type
Internal Type
Description
0
bool
bool
Whether Maple has approved `balancerPool` for BPT staking.

isValidCalc

Checks that a Calculator is valid.
1
function isValidCalc(
2
address calc,
3
uint8 calcType
4
) view returns (
5
bool
6
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
calc
address
address
The Calculator address.
1
calcType
uint8
uint8
The Calculator type.

Return Values:

Index
Name
Type
Internal Type
Description
0
bool
bool

isValidCollateralAsset (state variable)

1
function isValidCollateralAsset(
2
address
3
) view returns (
4
bool
5
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
``
address
address

Return Values:

Index
Name
Type
Internal Type
Description
0
bool
bool
Whether `collateralAsset` is valid.

isValidLiquidityAsset (state variable)

1
function isValidLiquidityAsset(
2
address
3
) view returns (
4
bool
5
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
``
address
address

Return Values:

Index
Name
Type
Internal Type
Description
0
bool
bool
Whether `liquidityAsset` is valid.

isValidLoanFactory (state variable)

1
function isValidLoanFactory(
2
address
3
) view returns (
4
bool
5
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
``
address
address

Return Values:

Index
Name
Type
Internal Type
Description
0
bool
bool
Whether `loanFactory` is valid.

isValidPoolDelegate (state variable)

Prevents unauthorized/unknown addresses from creating Pools.
1
function isValidPoolDelegate(
2
address
3
) view returns (
4
bool
5
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
``
address
address

Return Values:

Index
Name
Type
Internal Type
Description
0
bool
bool
Whether `poolDelegate` is valid.

isValidPoolFactory (state variable)

1
function isValidPoolFactory(
2
address
3
) view returns (
4
bool
5
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
``
address
address

Return Values:

Index
Name
Type
Internal Type
Description
0
bool
bool
Whether `poolFactory` is valid.

isValidSubFactory

Checks that a `subFactory` is valid as it relates to `superFactory`.
1
function isValidSubFactory(
2
address superFactory,
3
address subFactory,
4
uint8 factoryType
5
) view returns (
6
bool
7
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
superFactory
address
address
The core factory (e.g. PoolFactory, LoanFactory).
1
subFactory
address
address
The sub factory used by core factory (e.g. LiquidityLockerFactory).
2
factoryType
uint8
uint8
The type expected for the subFactory. 0 = COLLATERAL_LOCKER_FACTORY, 1 = DEBT_LOCKER_FACTORY, 2 = FUNDING_LOCKER_FACTORY, 3 = LIQUIDITY_LOCKER_FACTORY, 4 = STAKE_LOCKER_FACTORY.

Return Values:

Index
Name
Type
Internal Type
Description
0
bool
bool

lpCooldownPeriod (state variable)

The period (in secs) after which LPs are allowed to withdraw their funds from a Pool.
1
function lpCooldownPeriod(
2
) view returns (
3
uint256
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256

lpWithdrawWindow (state variable)

The window of time (in secs) after `lpCooldownPeriod` that an account has to withdraw before their intent to withdraw is invalidated.
1
function lpWithdrawWindow(
2
) view returns (
3
uint256
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256

mapleTreasury (state variable)

The MapleTreasury is the Treasury where all fees pass through for conversion, prior to distribution.
1
function mapleTreasury(
2
) view returns (
3
address
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
address
address

maxSwapSlippage (state variable)

The maximum amount of slippage for Uniswap transactions.
1
function maxSwapSlippage(
2
) view returns (
3
uint256
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256

minLoanEquity (state variable)

The minimum amount of LoanFDTs required to trigger liquidations (basis points percentage of totalSupply).
1
function minLoanEquity(
2
) view returns (
3
uint256
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256

mpl (state variable)

The ERC-2222 Maple Token for the Maple protocol.
1
function mpl(
2
) view returns (
3
address
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
address
address

oracleFor (state variable)

1
function oracleFor(
2
address
3
) view returns (
4
address
5
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
``
address
address

Return Values:

Index
Name
Type
Internal Type
Description
0
address
address
The Chainlink Oracle for the price of `asset`.

pendingGovernor (state variable)

The Governor that is declared for governorship transfer. Must be accepted for transfer to take effect.
1
function pendingGovernor(
2
) view returns (
3
address
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
address
address

protocolPaused (state variable)

Whether the functionality of the entire protocol is paused.
1
function protocolPaused(
2
) view returns (
3
bool
4
)
Copied!

Return Values:

Index
Name
Type
Internal Type
Description
0
bool
bool

setCalc

Sets the validity of a calculator contract. Only the Governor can call this function.
1
function setCalc(
2
address calc,
3
bool valid
4
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
calc
address
address
The Calculator address.
1
valid
bool
bool
The new validity status of a Calculator.

setCollateralAsset

Sets the validity of an asset for collateral. Only the Governor can call this function. It emits a `CollateralAssetSet` event.
1
function setCollateralAsset(
2
address asset,
3
bool valid
4
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
asset
address
address
The asset to assign validity to.
1
valid
bool
bool
The new validity status of a Collateral Asset.

setDefaultGracePeriod

Sets the default grace period. Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setDefaultGracePeriod(
2
uint256 _defaultGracePeriod
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
_defaultGracePeriod
uint256
uint256
The new number of seconds to set the grace period to.

setDefaultUniswapPath

Sets the path to swap an asset through Uniswap. Only the Governor can call this function. Set to == mid to enable a bilateral swap (single path swap). Set to != mid to enable a triangular swap (multi path swap).
1
function setDefaultUniswapPath(
2
address from,
3
address to,
4
address mid
5
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
from
address
address
The address of the asset being swapped.
1
to
address
address
The address of the final asset to receive.
2
mid
address
address
The intermediary asset for swaps, if any.

setFundingPeriod

Sets the funding period. Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setFundingPeriod(
2
uint256 _fundingPeriod
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
_fundingPeriod
uint256
uint256
The number of seconds to set the drawdown grace period to.

setGlobalAdmin

Sets the Global Admin. Only the Governor can call this function. It emits a `GlobalAdminSet` event.
1
function setGlobalAdmin(
2
address newGlobalAdmin
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
newGlobalAdmin
address
address
The new global admin address.

setInvestorFee

Sets the investor fee (in basis points). Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setInvestorFee(
2
uint256 _fee
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
_fee
uint256
uint256
The fee, e.g., 50 = 0.50%.

setLiquidityAsset

Sets the validity of an asset for liquidity in Pools. Only the Governor can call this function. It emits a `LiquidityAssetSet` event.
1
function setLiquidityAsset(
2
address asset,
3
bool valid
4
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
asset
address
address
The asset to assign validity to.
1
valid
bool
bool
The new validity status a Liquidity Asset in Pools.

setLpCooldownPeriod

Sets the Liquidity Pool cooldown period. This change will affect the existing cool down period for the LPs that already intended to withdraw. Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setLpCooldownPeriod(
2
uint256 newCooldownPeriod
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
newCooldownPeriod
uint256
uint256
The new value for the cool down period.

setLpWithdrawWindow

Sets the Liquidity Pool withdraw window. This change will affect the existing window for the LPs that already intended to withdraw. Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setLpWithdrawWindow(
2
uint256 newLpWithdrawWindow
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
newLpWithdrawWindow
uint256
uint256
The new value for the withdraw window.

setMapleTreasury

Sets the MapleTreasury. Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setMapleTreasury(
2
address _mapleTreasury
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
_mapleTreasury
address
address
A new MapleTreasury address.

setMaxSwapSlippage

Sets the allowed Uniswap slippage percentage, in basis points. Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setMaxSwapSlippage(
2
uint256 newMaxSlippage
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
newMaxSlippage
uint256
uint256
The new max slippage percentage (in basis points)

setMinLoanEquity

Sets the minimum Loan equity. Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setMinLoanEquity(
2
uint256 _minLoanEquity
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
_minLoanEquity
uint256
uint256
The new minimum percentage of Loan equity an account must have to trigger liquidations.

setPendingGovernor

Sets a new Pending Governor. This address can become Governor if they accept. Only the Governor can call this function. It emits a `PendingGovernorSet` event.
1
function setPendingGovernor(
2
address _pendingGovernor
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
_pendingGovernor
address
address
The address of a new Pending Governor.

setPoolDelegateAllowlist

Sets the validity of a Pool Delegate (those allowed to create Pools). Only the Governor can call this function. It emits a `PoolDelegateSet` event.
1
function setPoolDelegateAllowlist(
2
address delegate,
3
bool valid
4
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
delegate
address
address
1
valid
bool
bool
The new validity status of a Pool Delegate.

setPriceOracle

Sets a price feed's oracle. Only the Governor can call this function. It emits a `OracleSet` event.
1
function setPriceOracle(
2
address asset,
3
address oracle
4
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
asset
address
address
The asset to update price for.
1
oracle
address
address
The new Oracle to use for the price of `asset`.

setProtocolPause

Sets the paused/unpaused state of the protocol. Only the Global Admin can call this function. It emits a `ProtocolPaused` event.
1
function setProtocolPause(
2
bool pause
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
pause
bool
bool
A boolean flag to switch externally facing functionality in the protocol on/off.

setStakerCooldownPeriod

Sets the Staker cooldown period. This change will affect the existing cool down period for the Stakers that already intended to unstake. Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setStakerCooldownPeriod(
2
uint256 newCooldownPeriod
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
newCooldownPeriod
uint256
uint256
The new value for the cool down period.

setStakerUnstakeWindow

Sets the Staker unstake window. This change will affect the existing window for the Stakers that already intended to unstake. Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setStakerUnstakeWindow(
2
uint256 newUnstakeWindow
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
newUnstakeWindow
uint256
uint256
The new value for the unstake window.

setSwapOutRequired

Sets the the minimum Pool cover required to finalize a Pool. Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setSwapOutRequired(
2
uint256 amt
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
amt
uint256
uint256
The new minimum swap out required.

setTreasuryFee

Sets the treasury fee (in basis points). Only the Governor can call this function. It emits a `GlobalsParamSet` event.
1
function setTreasuryFee(
2
uint256 _fee
3
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
_fee
uint256
uint256
The fee, e.g., 50 = 0.50%.

setValidBalancerPool

Sets the validity of a Balancer Pool. Only the Governor can call this function. It emits a `BalancerPoolSet` event.
1
function setValidBalancerPool(
2
address balancerPool,
3
bool valid
4
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
balancerPool
address
address
The address of Balancer Pool contract.
1
valid
bool
bool
The new validity status of a Balancer Pool.

setValidLoanFactory

Sets the validity of a LoanFactory. Only the Governor can call this function.
1
function setValidLoanFactory(
2
address loanFactory,
3
bool valid
4
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
loanFactory
address
address
The address of a LoanFactory.
1
valid
bool
bool
The new validity status of `loanFactory`.

setValidPoolFactory

Sets the validity of a PoolFactory. Only the Governor can call this function.
1
function setValidPoolFactory(
2
address poolFactory,
3
bool valid
4
) nonpayable
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
poolFactory
address