The L2Pool.sol is the contract for the L2 optimized user facing methods of the protocol that takes byte encoded input arguments. It exposes the liquidity management methods that can be invoked using either Solidity or Web3 libraries.\
function supply(bytes32 args) external
Supplies asset into the protocol, minting the same amount of corresponding aTokens, and transferring them to
function supplyWithPermit(bytes32 args, bytes32 r, bytes32 s) external
Supply with transfer approval of supplied asset via permit function. This method removes the need for separate approval tx before supplying asset to the pool.
function withdraw(bytes32 args) external
amountof the underlying
asset, i.e. redeems the underlying token and burns the aTokens.
If user has any existing debt backed by the underlying token, then the max amount available to withdraw is the amount that will not leave user health factor < 1 after withdrawal.
function borrow(bytes32 args) external
interestRateMode, sending the
msg.sender, with the debt being incurred by
function repay(bytes32 args) external returns (uint256)
Repays debt of an
assetfor the given
function repayWithPermit(bytes32 args, bytes32 r, bytes32 s) external returns (uint256)
Repay with transfer approval of borrowed asset via permit function. This method removes the need for separate approval tx before repaying asset to the pool.
function repayWithATokens(bytes32 args) external override returns (uint256)
Allows user to repay with aTokens of the underlying debt asset without any approvals eg. Pay DAI debt using aDAI tokens.
function swapBorrowRateMode(bytes32 args) external
msg.sender's borrow rate mode between stable and variable.
function rebalanceStableBorrowRate(bytes32 args) external
Rebalances stable borrow rate of the user for given asset. In case of liquidity crunches on the protocol, stable rate borrows might need to be rebalanced to bring back equilibrium between the borrow and supply rates.
function setUserUseReserveAsCollateral(bytes32 args) external
Sets the asset of
msg.senderto be used as collateral or not.
function liquidationCall(bytes32 args1, bytes32 args2) external
Liquidate positions with a health factor below 1.