The protocol allows anyone to be a supplier. The funds provided by the supplier are used to issue loans for the borrower. We use ERC 4626 standard for our supply vault. When a user deposits funds to this, rToken (Representational tokens) are minted for the user. These rTokens represent users' share in the deposit vault. We follow a similar logic in the borrow token contract, though it is not designed to follow the 4626 standards (as it's not a vault). The user shall receive dToken (Debt token) for borrowing, representing the share of the total debt the user owes to the protocol.
Fig. 1 - Interaction between supply and borrow contracts
The above diagrams describe the basic actions a supplier and borrow can do. It shows how to borrow and supply contracts interact with each other.