-
Notifications
You must be signed in to change notification settings - Fork 1
Usage
After contracts deployment, the administrator needs to list supported cTokens in Comptroller.
supportMarket(cToken, name)
- cToken: TAddress - The address of the market (token) to list
- name: TString - The market name in price oracle
The first user operation is to provide a list of markets in which the user wants to participate. Comptroller function.
enterMarkets(cTokens)
- cTokens: TList(TAddress) - The list of addresses of the cToken markets to be enabled
Some user operations require preliminary conditions. They are fulfilled by the manual execution of the following functions. Note that they are valid only during a small period, and immediately invalidated after the user completes an operation.
Applies accrued interest to total borrows and reserves. cToken function. Should be executed for each market entered by the user.
accrueInterest()
Update price of the given asset. Comptroller function. Should be executed for each market entered by the user.
updateAssetPrice(asset)
- asset: TAddress - CToken market address
Updates stored liquidity for the given account. Comptroller function.
updateAccountLiquidity(account)
- account: TAddress - The account to calculate liquidity for
The available market operations:
- Mint
- Redeem
- Redeem Underlying
- Borrow
- Repay Borrow
- Repay Borrow Behalf
Those operations are called from cToken. For details please refer to CToken.
General information
Code description