PositionsManagerUtils
Inherits: MatchingEngine
Author: Morpho Labs.
Utils shared by the EntryPositionsManager and ExitPositionsManager.
Functions
_supplyToPool
POOL INTERACTION ///
Supplies underlying tokens to Aave.
function _supplyToPool(ERC20 _underlyingToken, uint256 _amount) internal;
Parameters
Name | Type | Description |
---|---|---|
_underlyingToken | ERC20 | The underlying token of the market to supply to. |
_amount | uint256 | The amount of token (in underlying). |
_withdrawFromPool
Withdraws underlying tokens from Aave.
function _withdrawFromPool(ERC20 _underlyingToken, address _poolToken, uint256 _amount) internal;
Parameters
Name | Type | Description |
---|---|---|
_underlyingToken | ERC20 | The underlying token of the market to withdraw from. |
_poolToken | address | The address of the market. |
_amount | uint256 | The amount of token (in underlying). |
_borrowFromPool
Borrows underlying tokens from Aave.
function _borrowFromPool(ERC20 _underlyingToken, uint256 _amount) internal;
Parameters
Name | Type | Description |
---|---|---|
_underlyingToken | ERC20 | The underlying token of the market to borrow from. |
_amount | uint256 | The amount of token (in underlying). |
_repayToPool
Repays underlying tokens to Aave.
function _repayToPool(ERC20 _underlyingToken, uint256 _amount) internal;
Parameters
Name | Type | Description |
---|---|---|
_underlyingToken | ERC20 | The underlying token of the market to repay to. |
_amount | uint256 | The amount of token (in underlying). |
Events
P2PBorrowDeltaUpdated
COMMON EVENTS ///
Emitted when the peer-to-peer borrow delta is updated.
event P2PBorrowDeltaUpdated(address indexed _poolToken, uint256 _p2pBorrowDelta);
P2PSupplyDeltaUpdated
Emitted when the peer-to-peer supply delta is updated.
event P2PSupplyDeltaUpdated(address indexed _poolToken, uint256 _p2pSupplyDelta);
P2PAmountsUpdated
Emitted when the supply and peer-to-peer borrow amounts are updated.
event P2PAmountsUpdated(address indexed _poolToken, uint256 _p2pSupplyAmount, uint256 _p2pBorrowAmount);
Errors
AddressIsZero
COMMON ERRORS ///
Thrown when the address is zero.
error AddressIsZero();
AmountIsZero
Thrown when the amount is equal to 0.
error AmountIsZero();