PositionsManager
Delegation contract managing the logic of Morpho's main entrypoints (supply, borrow, withdraw, repay, liquidate). Inherits from MatchingEngine and MorphoStorage to respectively apply the matching logic and store/update user positions.
Interface
Source code
morpho-core-v1/IPositionsManager.sol at main Β· morphodao/morpho-core-v1
GitHub
morpho-core-v1/PositionsManager.sol at main Β· morphodao/morpho-core-v1
GitHub

Methods

Each endpoint in this contract is responsible for its corresponding main contract's entrypoint and each endpoint is supposed to be delegate-called by the protocol's main contract.
Any call made to these endpoints won't affect the Morpho protocol unless the call originates from Morpho's main contract and is delegated (because the protocol's storage is managed by the protocol's main contract and Morpho's overall position on the underlying protocol is registered with the address of the main contract).

supplyLogic()

borrowLogic()

withdrawLogic()

repayLogic()

liquidateLogic()

_safeWithdrawLogic()

Internal method used the withdraw an amount of ERC20 tokens from Morpho, used in withdrawLogic and liquidateLogic() (on behalf of another user).

_safeRepayLogic()

Internal method used the repay an amount of ERC20 tokens to Morpho, used in repayLogic and liquidateLogic() (on behalf of another user).

_supplyToPool()

Utility function used to supply an amount of ERC20 tokens to the underlying protocol's pool, on behalf of the protocol.

_withdrawFromPool()

Utility function used to withdraw an amount of ERC20 tokens from the underlying protocol's pool, on behalf of the protocol.

_borrowFromPool()

Utility function used to borrow an amount of ERC20 tokens from the underlying protocol's pool, on behalf of the protocol.

_repayToPool()

Utility function used to repay an amount of ERC20 tokens to the underlying protocol's pool, on behalf of the protocol.
Copy link
On this page
Methods
supplyLogic()
borrowLogic()
withdrawLogic()
repayLogic()
liquidateLogic()
_safeWithdrawLogic()
_safeRepayLogic()
_supplyToPool()
_withdrawFromPool()
_borrowFromPool()
_repayToPool()