Create vault: vaults are ERC721 contracts that store token collateral to back MAI stablecoins. This function creates vaults for a user.
Deposit collateral: Collateral needs to be deposited into vaults in order to borrow MAI. The function below deposits collateral into vaults.
Borrow: the next step is to borrow MAI against the value of the deposited collateral tokens. The function below allows users to mint MAI in the form of a loan.
Repay: The function below allows users to repay their MAI debt.
Withdraw: the withdraw function below removes token collateral from vaults. To remove all collateral from vaults, users must first pay back their MAI debt.
Deposit: the function below deposits LP tokens into the staking contract, so that the user can participate in Qi rewards. This function also harvests the userβs accumulated rewards.
Harvest: to harvest, the user deposits 0 LP tokens using the function above.
Withdraw: the function below withdraws LP tokens from the staking contract and returns them to the userβs wallet. This function also harvests the userβs accumulated rewards.
Yield
This contract allows users to compound the rewards received from Aave Market tokens (amTokens), growing the amount of amTokens that the user has. All functions in this contract can be found in the following link: https://github.com/0xlaozi/qidao/blob/main/contracts/camToken.sol
Deposit: the function below deposits Aave market tokens into the camToken contract. It then returns a compounding Aave market token to the userβs wallet.
Claim Aave rewards: the function below claims user rewards on Aave.
Claim Matic rewards: the function below claims user Matic rewards on Aave.
Withdraw: the function below withdraws amTokens from the contract and returns them to the user.
Anchor (previously known as USDC Swap)
This contract allows users to create / mint MAI with accepted stablecoins as well as redeem stablecoins from MAI. To learn more about this feature, read the Anchor section here.
Redeem USDC from MAI: the function below allows users to redeem USDC from MAI.
Mint MAI with USDC: the function below allows users to mint new MAI with USDC.