Implementing an asset pool share and its deployer
When a lender deposits assets into an asset pool, the lender owns shares of the pool to represent the lender’s ownership of a portion of tokens in it. In this book, we will use the term asset pool share to represent the lender’s ownership.
Next, let’s introduce an asset pool share.
Introducing an asset pool share
Similar to the liquidity pool token we discussed in Chapter 5, Building Crypto-Trading Smart Contracts an asset pool share is also an ERC20 token. One share represents an amount of an asset token. After a period of time, the interest will be cumulated by the asset token amount for each share. So, a user can receive an amount of shares on a deposit, and after a period of time, the user can get more asset tokens when they redeem the same amount of shares on withdrawal. Figure 11.7 shows how a crypto loan uses the asset pool share in deposit and withdraw operations:
Figure...