Lend Assets
Last updated
Last updated
To deposit USDC into eUSDC directly, you may use the mint()
function present in all eToken contracts using the following arguments:
uint256
amount
The amount in shares to .
Below is a full implementation:
When you deposit USDC into eUSDC:
Your USDC tokens are transferred to the eToken contract.
You receive eUSDC tokens representing your lending position.
Your USDC becomes available for borrowers to borrow (subject to their collateral).
As borrowers pay interest, the exchange rate between eUSDC and USDC increases.
When you redeem your eUSDC tokens later, you receive your original USDC plus accrued interest.
If your app requires users to mint pTokens to another contract, you can use the mintFor()
function in the eToken contract using the following function arguments:
Calling mintFor()
:
uint256
amount
The amount of the underlying asset to deposit.
address
recipient
The account that should receive the eTokens.
Curvance offers a Universal Balance system that provides a simplified way to manage deposits by calling deposit()
in the UniversalBalance contract using the following function arguments:
uint256
amount
The amount of underlying token to be deposited.
bool
willLend
Whether the deposited underlying tokens should be lent out inside Curvance Protocol.
Implementation snippet:
For native gas tokens, Curvance provides a specialized Universal Balance Native contract:
Alternatively, if your app requires depositing for another address, you may use the depositFor()
and depositNativeFor()
functions in their respective contracts.
If you have many users to loan assets for, you may use the multiDepositFor()
function which deposits underlying token into recipients Universal Balance accounts, either to be held or lent out.
multiDepositFor() can be called with the following arguments: