Links

borrow()

This function allows suppliers to borrow some ERC20 tokens against their deposited collateral.
From a user standpoint, borrowing works exactly the same as the underlying lending pool. Since Morpho taps into the liquidity of the lending pool, users can borrow the same amounts they could have borrowed from the pool directly.
The maximum amount that can be borrowed depends on the collateral factor of the asset deposited. If there is enough supply for the demand to be matched, the user will benefit from a peer-to-peer credit line, at Morpho's peer-to-peer rate. Otherwise, the liquidity the user asked for will be borrowed from the underlying liquidity pool, until there's a corresponding supply offer for the liquidity on Morpho (in which case the user will automatically be matched).
function borrow(
address _poolTokenAddress,
uint256 _amount,
uint256 _maxGasForMatching = defaultMaxGasForMatching
)
Input parameter
Input type
Description
_poolTokenAddress
address
The address of the underlying protocol's pool token to borrow from.
_amount
uint256
The amount of underlying ERC20 tokens to borrow.
_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
Last modified 5mo ago