Credit Facility
Last updated
Last updated
The CreditFacility contract is a crucial component of the MintDeals platform, managing interactions with JustLend for asset management, collateral handling, borrowing, repaying, and yield claiming for increasing capacity.
Allows users to supply a specific amount of an underlying asset to JustLend.
Users receive cTokens in return.
The asset can be supplied for the sender or on behalf of another user (beneficiary).
Enables users to withdraw (redeem) a specific amount of the underlying asset from the protocol.
Ensures that the redemption doesn't cause under-collateralization.
Allows users to borrow a specific amount of a stablecoin from JustLend.
Checks if the borrowed amount is within the user's borrowing power.
Enables users to repay a specific amount of borrowed stablecoin.
Can be used to repay on behalf of another user (beneficiary).
Allows admins to enter markets as collateral, adding assets to the liquidity calculation.
Enables admins to add new cToken contracts to the system.
Allows admins to update the collateral factors for stablecoins and non-stablecoins.
Calculates the total borrowing power of a specific user based on their deposits.
Calculates the total amount of stablecoins borrowed by a user.
Calculates the total amount of stablecoin deposits and non-stablecoin deposits for a user.
Gets the USD valuation of a user's non-stablecoin asset deposits.
cTokens: Representation of supplied assets in the JustLend protocol.
Collateral Factors: Determine the borrowing power of supplied assets (different for stablecoins and non-stablecoins).
Borrowing Power: The maximum amount a user can borrow based on their supplied collateral.
This contract forms the backbone of MintDeals' credit facility, enabling businesses to leverage their membership fees as collateral for borrowing, while also managing asset supply, borrowing and repaying in a decentralized manner.