Links

supply()

This function allows users to supply ERC20 tokens to the Morpho protocol.
If there is enough demand for your supply to be matched (within the gas consumption limit you optionally provide, which is set by default by governance), you will benefit from a peer-to-peer credit line, at Morpho's peer-to-peer rate. Otherwise, your liquidity will be deposited on the underlying liquidity pool, until there's a corresponding borrow demand for the liquidity on Morpho (in which case the user will automatically be matched).
Suppliers must approve the Morpho contract to spend _amount of the underlying ERC20 token.
function supply(
address _poolTokenAddress,
address _onBehalf,
uint256 _amount,
uint256 _maxGasForMatching = defaultMaxGasForMatching
)
Input parameter
Input type
Description
_poolTokenAddress
address
The address of the underlying protocol's pool token to supply to.
_onBehalf
address
The address of the supplier who will benefit from the supplied amount. In most cases, you want to supply for yourself: _onBehalf === msg.sender
_amount
uint256
The amount of underlying ERC20 tokens to supply (the contract must have at least a corresponding allowance).
_maxGasForMatching
uint256, optional
The maximum amount of gas to consume to get you matched in peer-to-peer. This is an optional argument, whose default value is set by governance.
Reverts
Emitted Events