Maple
Search…
⌃K

Globals

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

Constructor

Constructor function. It emits an `Initialized` event.
constructor(
address _governor,
address _mpl,
address _globalAdmin
);

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.
function acceptGovernor()
nonpayable;

defaultGracePeriod [state variable]

The amount of time a Borrower has to make a missed payment before a default can be triggered.
function defaultGracePeriod()
view
returns (
uint256
);

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.
function defaultUniswapPath(
address tokenA,
address tokenB
)
view
returns (
address
);

Parameters:

Index
Name
Type
Internal Type
Description
0
tokenA
address
address
The address of the asset being swapped.
1
tokenB
address
address
The address of the final asset to receive.

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.
function fundingPeriod()
view
returns (
uint256
);

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256

getLatestPrice

Fetch price for asset from Chainlink oracles.
function getLatestPrice(
address asset
)
view
returns (
uint256
);

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.
function getLpCooldownParams()
view
returns (
uint256,
uint256
);

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.
function globalAdmin()
view
returns (
address
);

Return Values:

Index
Name
Type
Internal Type
Description
0
address
address

governor [state variable]

The Governor responsible for management of global Maple variables.
function governor()
view
returns (
address
);

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.
function investorFee()
view
returns (
uint256
);

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256

isValidBalancerPool [state variable]

function isValidBalancerPool(
address balancerPool
)
view
returns (
bool
);

Parameters:

Index
Name
Type
Internal Type
Description
0
balancerPool
address
address
The address of a Balancer Pool.

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.
function isValidCalc(
address calc,
uint8 calcType
)
view
returns (
bool
);

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]

function isValidCollateralAsset(
address collateralAsset
)
view
returns (
bool
);

Parameters:

Index
Name
Type
Internal Type
Description
0
collateralAsset
address
address
The address of a Collateral Asset.

Return Values:

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

isValidLiquidityAsset [state variable]

function isValidLiquidityAsset(
address liquidityAsset
)
view
returns (
bool
);

Parameters:

Index
Name
Type
Internal Type
Description
0
liquidityAsset
address
address
The address of a Liquidity Asset.

Return Values:

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

isValidLoanFactory [state variable]

function isValidLoanFactory(
address loanFactory
)
view
returns (
bool
);

Parameters:

Index
Name
Type
Internal Type
Description
0
loanFactory
address
address
The address of a Loan Factory.

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.
function isValidPoolDelegate(
address poolDelegate
)
view
returns (
bool
);

Parameters:

Index
Name
Type
Internal Type
Description
0
poolDelegate
address
address
The address of a Pool Delegate.

Return Values:

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

isValidPoolFactory [state variable]

function isValidPoolFactory(
address poolFactory
)
view
returns (
bool
);

Parameters:

Index
Name
Type
Internal Type
Description
0
poolFactory
address
address
The address of a Pool Factory.

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`.
function isValidSubFactory(
address superFactory,
address subFactory,
uint8 factoryType
)
view
returns (
bool
);

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.
function lpCooldownPeriod()
view
returns (
uint256
);

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.
function lpWithdrawWindow()
view
returns (
uint256
);

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.
function mapleTreasury()
view
returns (
address
);

Return Values:

Index
Name
Type
Internal Type
Description
0
address
address

maxSwapSlippage [state variable]

The maximum amount of slippage for Uniswap transactions.
function maxSwapSlippage()
view
returns (
uint256
);

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).
function minLoanEquity()
view
returns (
uint256
);

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256

mpl [state variable]

The ERC-2222 Maple Token for the Maple protocol.
function mpl()
pure
returns (
address
);

Return Values:

Index
Name
Type
Internal Type
Description
0
address
address

oracleFor [state variable]

function oracleFor(
address asset
)
view
returns (
address
);

Parameters:

Index
Name
Type
Internal Type
Description
0
asset
address
address
The address of some token.

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.
function pendingGovernor()
view
returns (
address
);

Return Values:

Index
Name
Type
Internal Type
Description
0
address
address

protocolPaused [state variable]

Whether the functionality of the entire protocol is paused.
function protocolPaused()
view
returns (
bool
);

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.
function setCalc(
address calc,
bool valid
)
nonpayable;

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.
function setCollateralAsset(
address asset,
bool valid
)
nonpayable;

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.
function setDefaultGracePeriod(
uint256 _defaultGracePeriod
)
nonpayable;

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).
function setDefaultUniswapPath(
address from,
address to,
address mid
)
nonpayable;

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.
function setFundingPeriod(