Flow: Earning interest
To earn interest on deposits, the user must have coins to deposit into the LendingMarket
that matches the type of one of the reserve
s. It is not necessary to have an obligation
to earn interest. It is sufficient to simply hold cTokens.
cTokens effectively represent shares in the pool of a particular coin. While the cToken is held, any increases in the total value held by the pool is reflected in the cToken if it is redeemed.
To obtain cTokens, the user needs to call deposit_liquidity_and_mint_ctokens
with coins of a type that corresponds to one of the reserves. To withdraw the interest, it is necessary to redeem the cTokens for the original coin type by calling redeem_ctokens_and_withdraw_liquidity
. There is a risk that the pool is lent out to such an extent that it is no longer possible to redeem the cTokens.